Linux backports project
 help / color / mirror / Atom feed
* [PATCH 00/20] backports: add missing backport-include header definitions
@ 2026-06-24  7:38 Yi Cong
  2026-06-24  7:38 ` [PATCH 01/20] headers: Add timer_shutdown_sync() Yi Cong
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

This series adds a number of backport-include header definitions that
are currently missing from the backports tree. These are the small
compatibility shims needed so that backported drivers can reference
kernel APIs that were added in newer kernels.

The patches only add new definitions (new headers, or new wrappers
appended to existing ones); none of them modify or remove existing
backport code. Each definition is guarded with the usual
LINUX_VERSION_IS_LESS()/LINUX_VERSION_IN_RANGE() checks so it takes
effect only on kernels where the native definition is absent, and the
wrappers follow the upstream calling convention.

This is the first batch of a larger set of changes; the remaining
patches (which modify existing backport code and patches) will be sent
separately once this batch is reviewed.

Yi Cong (20):
  headers: Add timer_shutdown_sync()
  headers: include linux/module.h from backport.h
  headers: add kstrtox.h backport
  headers: add get_random_u32_inclusive() for kernels < 6.2
  headers: add genl_split_ops compat for kernels < 6.2
  headers: add thermal_zone_device_register_with_trips backport
  headers: add trace_sk_data_ready no-op for kernels < 6.0
  headers: add dropreason-core.h backport for kernels < 5.17
  headers: add dropreason.h backport for kernels < 6.0
  headers: add kfree_skb_reason() backport for kernels < 5.17
  headers: add thermal_zone_device_priv() backport for kernels < 6.4
  headers: add genl_small_ops backport for kernels < 5.10
  headers: add class_create() single-argument backport for kernels < 6.4
  headers: add list_count_nodes() backport for kernels < 6.5
  headers: add net/gso.h backport for kernels < 6.5
  headers: add vcalloc() backport for kernels < 5.18
  headers: add __counted_by macro for kernels < 6.6
  headers: add crypto/utils.h redirect for kernels < 6.6
  headers: add led_trigger_blink/oneshot value-to-pointer backport for
    kernels < 6.5
  headers: add of_property_present backport for kernels < 5.18

 backport/backport-include/backport/backport.h |  1 +
 backport/backport-include/crypto/utils.h      | 16 +++++++
 .../linux/compiler_attributes.h               |  8 ++++
 backport/backport-include/linux/device.h      | 14 ++++++
 backport/backport-include/linux/kstrtox.h     | 17 ++++++++
 backport/backport-include/linux/leds.h        | 39 +++++++++++++++++
 backport/backport-include/linux/list.h        | 25 +++++++++++
 backport/backport-include/linux/of.h          | 14 ++++++
 backport/backport-include/linux/random.h      |  7 +++
 backport/backport-include/linux/skbuff.h      | 17 ++++++++
 backport/backport-include/linux/thermal.h     | 25 +++++++++++
 backport/backport-include/linux/timer.h       | 14 ++++++
 backport/backport-include/linux/vmalloc.h     | 25 +++++++++++
 .../backport-include/net/dropreason-core.h    | 34 +++++++++++++++
 backport/backport-include/net/dropreason.h    | 43 +++++++++++++++++++
 backport/backport-include/net/genetlink.h     | 16 +++++++
 backport/backport-include/net/gso.h           | 16 +++++++
 backport/backport-include/trace/events/sock.h | 16 +++++++
 18 files changed, 347 insertions(+)
 create mode 100644 backport/backport-include/crypto/utils.h
 create mode 100644 backport/backport-include/linux/kstrtox.h
 create mode 100644 backport/backport-include/linux/leds.h
 create mode 100644 backport/backport-include/linux/list.h
 create mode 100644 backport/backport-include/linux/of.h
 create mode 100644 backport/backport-include/linux/vmalloc.h
 create mode 100644 backport/backport-include/net/dropreason-core.h
 create mode 100644 backport/backport-include/net/dropreason.h
 create mode 100644 backport/backport-include/net/gso.h
 create mode 100644 backport/backport-include/trace/events/sock.h

-- 
2.43.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 01/20] headers: Add timer_shutdown_sync()
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 02/20] headers: include linux/module.h from backport.h Yi Cong
                   ` (18 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

timer_shutdown_sync() was introduced in v6.2. On older kernels it needs
to delete the timer and set its function callback to NULL to emulate the
shutdown semantics (prevent the timer from being rearmed).

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/linux/timer.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/backport/backport-include/linux/timer.h b/backport/backport-include/linux/timer.h
index 14467fb6..36e15340 100644
--- a/backport/backport-include/linux/timer.h
+++ b/backport/backport-include/linux/timer.h
@@ -79,4 +79,18 @@ static inline int timer_delete_sync(struct timer_list *timer)
 }
 #endif /* < 6.1.84 */
 
+#if LINUX_VERSION_IS_LESS(6,2,0)
+static inline int timer_shutdown_sync(struct timer_list *timer)
+{
+    int ret = del_timer_sync(timer);
+    /*
+     * Emulate shutdown semantics: mark as dead to prevent accidental reuse.
+     * Safe to do after del_timer_sync() because timer is no longer
+     * referenced by the timer subsystem.
+     */
+    timer->function = NULL;
+    return ret;
+}
+#endif
+
 #endif /* _BACKPORT_TIMER_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 02/20] headers: include linux/module.h from backport.h
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
  2026-06-24  7:38 ` [PATCH 01/20] headers: Add timer_shutdown_sync() Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 03/20] headers: add kstrtox.h backport Yi Cong
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

In v6.2, include/linux/device/driver.h includes linux/module.h, so
files using module_param() get it transitively.  In v5.4 there is no
separate device/driver.h and the include chain does not reach
module.h, causing implicit-declaration errors for module_param() and
related macros.

Include <linux/module.h> from backport.h, which is force-included
via -include on every compilation unit, ensuring module_param and
friends are always available.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/backport/backport.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/backport/backport-include/backport/backport.h b/backport/backport-include/backport/backport.h
index d1d3b102..be8668eb 100644
--- a/backport/backport-include/backport/backport.h
+++ b/backport/backport-include/backport/backport.h
@@ -8,6 +8,7 @@
 
 #ifndef __ASSEMBLY__
 #define LINUX_BACKPORT(__sym) backport_ ##__sym
+#include <linux/module.h>
 #ifndef CONFIG_BACKPORT_INTEGRATE
 #include <backport/checks.h>
 #endif
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 03/20] headers: add kstrtox.h backport
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
  2026-06-24  7:38 ` [PATCH 01/20] headers: Add timer_shutdown_sync() Yi Cong
  2026-06-24  7:38 ` [PATCH 02/20] headers: include linux/module.h from backport.h Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 04/20] headers: add get_random_u32_inclusive() for kernels < 6.2 Yi Cong
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

The separate <linux/kstrtox.h> header was introduced in v5.14
(commit 29b25d81ef62).  Before that, kstrto*() declarations live
in <linux/kernel.h>.

Provide a compatibility wrapper that includes <linux/kernel.h> on
kernels older than v5.14.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/linux/kstrtox.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 backport/backport-include/linux/kstrtox.h

diff --git a/backport/backport-include/linux/kstrtox.h b/backport/backport-include/linux/kstrtox.h
new file mode 100644
index 00000000..a17d072b
--- /dev/null
+++ b/backport/backport-include/linux/kstrtox.h
@@ -0,0 +1,17 @@
+#ifndef __BACKPORT_KSTRTOX_H
+#define __BACKPORT_KSTRTOX_H
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(5,14,0)
+/*
+ * Before Linux 5.14, kstrto* functions were declared in linux/kernel.h.
+ * The separate linux/kstrtox.h header was introduced in commit
+ * 29b25d81ef62 ("lib/kstrtox: move kstrto*() from lib/cmdline.c to
+ * lib/kstrtox.c, add tests").
+ */
+#include <linux/kernel.h>
+#else
+#include_next <linux/kstrtox.h>
+#endif
+
+#endif /* __BACKPORT_KSTRTOX_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 04/20] headers: add get_random_u32_inclusive() for kernels < 6.2
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
                   ` (2 preceding siblings ...)
  2026-06-24  7:38 ` [PATCH 03/20] headers: add kstrtox.h backport Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 05/20] headers: add genl_split_ops compat " Yi Cong
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

get_random_u32_inclusive() was introduced in v6.2.  Provide it as a
static inline backed by the older prandom_u32_max() helper.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/linux/random.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/backport/backport-include/linux/random.h b/backport/backport-include/linux/random.h
index f4fd47dc..6437d55e 100644
--- a/backport/backport-include/linux/random.h
+++ b/backport/backport-include/linux/random.h
@@ -15,4 +15,11 @@ static inline u16 get_random_u16(void)
 }
 #endif
 
+#if LINUX_VERSION_IS_LESS(6,2,0)
+static inline u32 get_random_u32_inclusive(u32 floor, u32 ceiling)
+{
+	return prandom_u32_max(ceiling - floor + 1) + floor;
+}
+#endif
+
 #endif /* __BACKPORT_RANDOM_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 05/20] headers: add genl_split_ops compat for kernels < 6.2
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
                   ` (3 preceding siblings ...)
  2026-06-24  7:38 ` [PATCH 04/20] headers: add get_random_u32_inclusive() for kernels < 6.2 Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 06/20] headers: add thermal_zone_device_register_with_trips backport Yi Cong
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

genl_split_ops was introduced in v6.2; for older kernels, define it
as an alias for genl_ops so that pre_doit / post_doit callbacks in
nl80211.c compile without changes.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/net/genetlink.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/backport/backport-include/net/genetlink.h b/backport/backport-include/net/genetlink.h
index c3f05fc0..b98d7110 100644
--- a/backport/backport-include/net/genetlink.h
+++ b/backport/backport-include/net/genetlink.h
@@ -3,6 +3,10 @@
 #include_next <net/genetlink.h>
 #include <linux/version.h>
 
+#if LINUX_VERSION_IS_LESS(6,2,0)
+#define genl_split_ops genl_ops
+#endif
+
 /* this is for patches we apply */
 static inline struct netlink_ext_ack *genl_callback_extack(struct netlink_callback *cb)
 {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 06/20] headers: add thermal_zone_device_register_with_trips backport
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
                   ` (4 preceding siblings ...)
  2026-06-24  7:38 ` [PATCH 05/20] headers: add genl_split_ops compat " Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 07/20] headers: add trace_sk_data_ready no-op for kernels < 6.0 Yi Cong
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

v6.3 mt76 and other drivers use thermal_zone_device_register_with_trips()
which was introduced in v6.0.  Map it to thermal_zone_device_register()
for older kernels, passing 0 as num_trips and NULL as trips.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/linux/thermal.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/backport/backport-include/linux/thermal.h b/backport/backport-include/linux/thermal.h
index f1663eff..af3c114f 100644
--- a/backport/backport-include/linux/thermal.h
+++ b/backport/backport-include/linux/thermal.h
@@ -25,4 +25,22 @@ static inline int thermal_zone_device_disable(struct thermal_zone_device *tz)
 { return 0; }
 #endif /* < 5.9 */
 
+#if LINUX_VERSION_IS_LESS(6,0,0)
+#define thermal_zone_device_register_with_trips LINUX_BACKPORT(thermal_zone_device_register_with_trips)
+static inline struct thermal_zone_device *
+thermal_zone_device_register_with_trips(const char *type,
+					 struct thermal_trip *trips,
+					 int num_trips, int mask,
+					 void *devdata,
+					 struct thermal_zone_device_ops *ops,
+					 struct thermal_zone_params *tzp,
+					 int passive_delay,
+					 int polling_delay)
+{
+	return thermal_zone_device_register(type, num_trips, mask, devdata,
+					    ops, tzp, passive_delay,
+					    polling_delay);
+}
+#endif /* < 6.0 */
+
 #endif /* __BACKPORT_LINUX_THERMAL_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 07/20] headers: add trace_sk_data_ready no-op for kernels < 6.0
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
                   ` (5 preceding siblings ...)
  2026-06-24  7:38 ` [PATCH 06/20] headers: add thermal_zone_device_register_with_trips backport Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 08/20] headers: add dropreason-core.h backport for kernels < 5.17 Yi Cong
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

v6.3 qrtr/ns.c calls trace_sk_data_ready() which was added in v6.0.
Provide a no-op macro stub for older kernels.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/trace/events/sock.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 backport/backport-include/trace/events/sock.h

diff --git a/backport/backport-include/trace/events/sock.h b/backport/backport-include/trace/events/sock.h
new file mode 100644
index 00000000..7b068aa8
--- /dev/null
+++ b/backport/backport-include/trace/events/sock.h
@@ -0,0 +1,16 @@
+#ifndef __BACKPORT_TRACE_SOCK_H
+#define __BACKPORT_TRACE_SOCK_H
+#include_next <trace/events/sock.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(6,0,0)
+/*
+ * trace_sk_data_ready() was added in v6.0.  On older kernels, provide
+ * a no-op stub so that callers compile cleanly.
+ */
+#ifndef trace_sk_data_ready
+#define trace_sk_data_ready(sk) do {} while (0)
+#endif
+#endif
+
+#endif /* __BACKPORT_TRACE_SOCK_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 08/20] headers: add dropreason-core.h backport for kernels < 5.17
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
                   ` (6 preceding siblings ...)
  2026-06-24  7:38 ` [PATCH 07/20] headers: add trace_sk_data_ready no-op for kernels < 6.0 Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 09/20] headers: add dropreason.h backport for kernels < 6.0 Yi Cong
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

The skb drop reason infrastructure was introduced in v5.17. Provide
minimal enum skb_drop_reason definitions (SKB_NOT_DROPPED_YET,
SKB_CONSUMED) and SKB_DROP_REASON_SUBSYS_SHIFT/MASK constants so that
mac80211 drop.h compiles on older kernels.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 .../backport-include/net/dropreason-core.h    | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 backport/backport-include/net/dropreason-core.h

diff --git a/backport/backport-include/net/dropreason-core.h b/backport/backport-include/net/dropreason-core.h
new file mode 100644
index 00000000..2b02a8f1
--- /dev/null
+++ b/backport/backport-include/net/dropreason-core.h
@@ -0,0 +1,34 @@
+#ifndef __BACKPORT_NET_DROPREASON_CORE_H
+#define __BACKPORT_NET_DROPREASON_CORE_H
+#include <linux/version.h>
+
+/*
+ * On kernels >= 5.17, enum skb_drop_reason and the related helpers exist
+ * in the kernel's own skbuff.h / dropreason-core.h.  For older kernels we
+ * provide minimal definitions so that backported wireless drivers compile.
+ */
+#if LINUX_VERSION_IS_LESS(5,17,0)
+
+/**
+ * enum skb_drop_reason - reasons an sk_buff was dropped
+ *
+ * This is a minimal backport that only defines the few values used by
+ * the mac80211 subsystem.  The full upstream enum is much larger.
+ */
+enum skb_drop_reason {
+	SKB_NOT_DROPPED_YET = 0,
+	SKB_CONSUMED,
+	SKB_DROP_REASON_NOT_SPECIFIED,
+};
+
+/*
+ * Subsystem support was added in 6.0.  For kernels between 5.17 and 6.0
+ * the subsys fields do not exist; for kernels < 5.17 we define them here
+ * so that the mac80211 drop.h header compiles.
+ */
+#define SKB_DROP_REASON_SUBSYS_SHIFT		16
+#define SKB_DROP_REASON_SUBSYS_MASK		0xffff0000
+
+#endif /* < 5.17 */
+
+#endif /* __BACKPORT_NET_DROPREASON_CORE_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 09/20] headers: add dropreason.h backport for kernels < 6.0
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
                   ` (7 preceding siblings ...)
  2026-06-24  7:38 ` [PATCH 08/20] headers: add dropreason-core.h backport for kernels < 5.17 Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 10/20] headers: add kfree_skb_reason() backport for kernels < 5.17 Yi Cong
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

The subsystem-based drop reason infrastructure was introduced in v6.0
and extended in v6.4. Provide enum skb_drop_reason_subsys, struct
drop_reason_list, and no-op stubs for drop_reasons_register_subsys()
and drop_reasons_unregister_subsys() so that mac80211 compiles on
older kernels.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/net/dropreason.h | 43 ++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 backport/backport-include/net/dropreason.h

diff --git a/backport/backport-include/net/dropreason.h b/backport/backport-include/net/dropreason.h
new file mode 100644
index 00000000..55b11c13
--- /dev/null
+++ b/backport/backport-include/net/dropreason.h
@@ -0,0 +1,43 @@
+#ifndef __BACKPORT_NET_DROPREASON_H
+#define __BACKPORT_NET_DROPREASON_H
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_GEQ(6,0,0)
+/* On new kernels, the real header is already available. */
+#include_next <net/dropreason.h>
+#else
+
+#include <net/dropreason-core.h>
+
+/*
+ * Minimal backport of the subsystem-based drop reason infrastructure
+ * that was introduced in kernel 6.0 and extended in 6.4.
+ */
+
+enum skb_drop_reason_subsys {
+	SKB_DROP_REASON_SUBSYS_CORE,
+	SKB_DROP_REASON_SUBSYS_MAC80211_UNUSABLE,
+	SKB_DROP_REASON_SUBSYS_MAC80211_MONITOR,
+	SKB_DROP_REASON_SUBSYS_NUM
+};
+
+struct drop_reason_list {
+	const char * const *reasons;
+	size_t n_reasons;
+};
+
+/* No-op stubs for registration */
+static inline void
+drop_reasons_register_subsys(enum skb_drop_reason_subsys subsys,
+			     const struct drop_reason_list *list)
+{
+}
+
+static inline void
+drop_reasons_unregister_subsys(enum skb_drop_reason_subsys subsys)
+{
+}
+
+#endif /* < 6.0 */
+
+#endif /* __BACKPORT_NET_DROPREASON_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 10/20] headers: add kfree_skb_reason() backport for kernels < 5.17
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
                   ` (8 preceding siblings ...)
  2026-06-24  7:38 ` [PATCH 09/20] headers: add dropreason.h backport for kernels < 6.0 Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 11/20] headers: add thermal_zone_device_priv() backport for kernels < 6.4 Yi Cong
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

kfree_skb_reason() was introduced in v5.17 along with enum
skb_drop_reason. Provide an inline wrapper that discards the reason
and calls kfree_skb() on older kernels.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/linux/skbuff.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index 36b83fdf..8193448d 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -103,4 +103,21 @@ static inline bool skb_queue_empty_lockless(const struct sk_buff_head *list)
 }
 #endif /* < 5.4 */
 
+#if LINUX_VERSION_IS_LESS(5,17,0)
+/*
+ * kfree_skb_reason() was introduced in kernel 5.17 along with
+ * enum skb_drop_reason. For older kernels provide a simple wrapper
+ * that discards the reason and calls kfree_skb().
+ *
+ * The enum is provided in our backport dropreason-core.h header.
+ */
+#include <net/dropreason-core.h>
+
+static inline void kfree_skb_reason(struct sk_buff *skb,
+				    enum skb_drop_reason reason)
+{
+	kfree_skb(skb);
+}
+#endif
+
 #endif /* __BACKPORT_SKBUFF_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 11/20] headers: add thermal_zone_device_priv() backport for kernels < 6.4
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
                   ` (9 preceding siblings ...)
  2026-06-24  7:38 ` [PATCH 10/20] headers: add kfree_skb_reason() backport for kernels < 5.17 Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 12/20] headers: add genl_small_ops backport for kernels < 5.10 Yi Cong
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

thermal_zone_device_priv() was introduced in v6.4 to replace direct
access to tz->devdata. Provide an inline wrapper for older kernels.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/linux/thermal.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/backport/backport-include/linux/thermal.h b/backport/backport-include/linux/thermal.h
index af3c114f..ea6568d0 100644
--- a/backport/backport-include/linux/thermal.h
+++ b/backport/backport-include/linux/thermal.h
@@ -43,4 +43,11 @@ thermal_zone_device_register_with_trips(const char *type,
 }
 #endif /* < 6.0 */
 
+#if LINUX_VERSION_IS_LESS(6,4,0)
+static inline void *thermal_zone_device_priv(struct thermal_zone_device *tz)
+{
+	return tz->devdata;
+}
+#endif /* < 6.4 */
+
 #endif /* __BACKPORT_LINUX_THERMAL_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 12/20] headers: add genl_small_ops backport for kernels < 5.10
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
                   ` (10 preceding siblings ...)
  2026-06-24  7:38 ` [PATCH 11/20] headers: add thermal_zone_device_priv() backport for kernels < 6.4 Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 13/20] headers: add class_create() single-argument backport for kernels < 6.4 Yi Cong
                   ` (7 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

genl_small_ops was introduced in v5.10 as a more compact
representation of genl_ops. For older kernels, alias genl_small_ops
to genl_ops and map small_ops/n_small_ops struct fields to ops/n_ops.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/net/genetlink.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/backport/backport-include/net/genetlink.h b/backport/backport-include/net/genetlink.h
index b98d7110..a57cd200 100644
--- a/backport/backport-include/net/genetlink.h
+++ b/backport/backport-include/net/genetlink.h
@@ -7,6 +7,18 @@
 #define genl_split_ops genl_ops
 #endif
 
+#if LINUX_VERSION_IS_LESS(5,10,0)
+/*
+ * genl_small_ops was introduced in v5.10 to allow a more compact
+ * representation of genl_ops.  For older kernels, just alias it to
+ * genl_ops and map the struct genl_family small_ops/n_small_ops
+ * fields to ops/n_ops.
+ */
+#define genl_small_ops genl_ops
+#define small_ops ops
+#define n_small_ops n_ops
+#endif
+
 /* this is for patches we apply */
 static inline struct netlink_ext_ack *genl_callback_extack(struct netlink_callback *cb)
 {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 13/20] headers: add class_create() single-argument backport for kernels < 6.4
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
                   ` (11 preceding siblings ...)
  2026-06-24  7:38 ` [PATCH 12/20] headers: add genl_small_ops backport for kernels < 5.10 Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 14/20] headers: add list_count_nodes() backport for kernels < 6.5 Yi Cong
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

In v6.4 class_create() was simplified to take only the name argument,
using THIS_MODULE implicitly. For older kernels, provide a wrapper
that forwards to the two-argument __class_create() macro.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/linux/device.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h
index 06595285..069337b7 100644
--- a/backport/backport-include/linux/device.h
+++ b/backport/backport-include/linux/device.h
@@ -12,4 +12,18 @@
 	struct device_attribute dev_attr_##_name = __ATTR_RO_MODE(_name, 0400)
 #endif
 
+#if LINUX_VERSION_IS_LESS(6,4,0)
+/*
+ * class_create() in v6.4+ takes only the name argument and uses
+ * THIS_MODULE implicitly.  For older kernels, provide a wrapper
+ * that forwards to the 2-argument macro version.
+ */
+#undef class_create
+#define class_create(name) \
+({ \
+	static struct lock_class_key __key; \
+	__class_create(THIS_MODULE, (name), &__key); \
+})
+#endif
+
 #endif /* __BACKPORT_DEVICE_H_ */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 14/20] headers: add list_count_nodes() backport for kernels < 6.5
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
                   ` (12 preceding siblings ...)
  2026-06-24  7:38 ` [PATCH 13/20] headers: add class_create() single-argument backport for kernels < 6.4 Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 15/20] headers: add net/gso.h " Yi Cong
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

list_count_nodes() was introduced in v6.5 to count the number of
nodes in a struct list_head. Provide an inline backport using
list_for_each() for older kernels.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/linux/list.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 backport/backport-include/linux/list.h

diff --git a/backport/backport-include/linux/list.h b/backport/backport-include/linux/list.h
new file mode 100644
index 00000000..47d8d24f
--- /dev/null
+++ b/backport/backport-include/linux/list.h
@@ -0,0 +1,25 @@
+#ifndef __BACKPORT_LINUX_LIST_H
+#define __BACKPORT_LINUX_LIST_H
+#include_next <linux/list.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(6,5,0)
+/**
+ * list_count_nodes - count nodes in the list
+ * @head:	the head for your list.
+ *
+ * Introduced in v6.5. Provide a backport for older kernels.
+ */
+static inline size_t list_count_nodes(struct list_head *head)
+{
+	struct list_head *pos;
+	size_t count = 0;
+
+	list_for_each(pos, head)
+		count++;
+
+	return count;
+}
+#endif
+
+#endif /* __BACKPORT_LINUX_LIST_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 15/20] headers: add net/gso.h backport for kernels < 6.5
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
                   ` (13 preceding siblings ...)
  2026-06-24  7:38 ` [PATCH 14/20] headers: add list_count_nodes() backport for kernels < 6.5 Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 16/20] headers: add vcalloc() backport for kernels < 5.18 Yi Cong
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

In v6.5 GSO helpers (skb_gso_segment, etc.) were extracted from
linux/netdevice.h into a new net/gso.h header. For older kernels,
this backport simply includes the existing headers where these
functions are already defined.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/net/gso.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 backport/backport-include/net/gso.h

diff --git a/backport/backport-include/net/gso.h b/backport/backport-include/net/gso.h
new file mode 100644
index 00000000..ccc1e3d4
--- /dev/null
+++ b/backport/backport-include/net/gso.h
@@ -0,0 +1,16 @@
+#ifndef __BACKPORT_NET_GSO_H
+#define __BACKPORT_NET_GSO_H
+#include <linux/version.h>
+
+/*
+ * net/gso.h was introduced in v6.5 by extracting GSO helpers from
+ * linux/netdevice.h and linux/skbuff.h.  On older kernels these
+ * functions are already available through the existing headers, so
+ * this backport simply pulls in the relevant includes.
+ */
+#if LINUX_VERSION_IS_LESS(6,5,0)
+#include <linux/netdevice.h>
+#include <linux/skbuff.h>
+#endif
+
+#endif /* __BACKPORT_NET_GSO_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 16/20] headers: add vcalloc() backport for kernels < 5.18
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
                   ` (14 preceding siblings ...)
  2026-06-24  7:38 ` [PATCH 15/20] headers: add net/gso.h " Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 17/20] headers: add __counted_by macro for kernels < 6.6 Yi Cong
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

vcalloc() was introduced in v5.18 to allocate and zero virtually
contiguous memory with overflow-checked multiplication. Provide a
wrapper using vzalloc() for older kernels.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/linux/vmalloc.h | 25 +++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 backport/backport-include/linux/vmalloc.h

diff --git a/backport/backport-include/linux/vmalloc.h b/backport/backport-include/linux/vmalloc.h
new file mode 100644
index 00000000..233c8608
--- /dev/null
+++ b/backport/backport-include/linux/vmalloc.h
@@ -0,0 +1,25 @@
+#ifndef __BACKPORT_LINUX_VMALLOC_H
+#define __BACKPORT_LINUX_VMALLOC_H
+#include_next <linux/vmalloc.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(5,18,0)
+/**
+ * vcalloc - allocate virtually contiguous memory and zero it
+ * @n:		number of elements
+ * @size:	size of each element
+ *
+ * Introduced in v5.18. On older kernels, fall back to vzalloc()
+ * with overflow-checked multiplication.
+ */
+static inline void *vcalloc(size_t n, size_t size)
+{
+	size_t bytes;
+	if (size && n > SIZE_MAX / size)
+		return NULL;
+	bytes = n * size;
+	return vzalloc(bytes);
+}
+#endif
+
+#endif /* __BACKPORT_LINUX_VMALLOC_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 17/20] headers: add __counted_by macro for kernels < 6.6
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
                   ` (15 preceding siblings ...)
  2026-06-24  7:38 ` [PATCH 16/20] headers: add vcalloc() backport for kernels < 5.18 Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 18/20] headers: add crypto/utils.h redirect " Yi Cong
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

__counted_by() was introduced in v6.6 as a compiler attribute for
flexible array member bounds checking. Add a definition that expands
to the attribute when supported by the compiler, or to nothing
otherwise.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/linux/compiler_attributes.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/backport/backport-include/linux/compiler_attributes.h b/backport/backport-include/linux/compiler_attributes.h
index 31ddc163..b39b66b5 100644
--- a/backport/backport-include/linux/compiler_attributes.h
+++ b/backport/backport-include/linux/compiler_attributes.h
@@ -31,4 +31,12 @@
 #endif
 #endif /* fallthrough */
 
+#ifndef __counted_by
+#if __has_attribute(__counted_by__)
+# define __counted_by(member)		__attribute__((__counted_by__(member)))
+#else
+# define __counted_by(member)
+#endif
+#endif /* __counted_by */
+
 #endif /* _BACKPORTS_LINUX_COMPILER_ATTRIBUTES_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 18/20] headers: add crypto/utils.h redirect for kernels < 6.6
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
                   ` (16 preceding siblings ...)
  2026-06-24  7:38 ` [PATCH 17/20] headers: add __counted_by macro for kernels < 6.6 Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 19/20] headers: add led_trigger_blink/oneshot value-to-pointer backport for kernels < 6.5 Yi Cong
  2026-06-24  7:38 ` [PATCH 20/20] headers: add of_property_present backport for kernels < 5.18 Yi Cong
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

In v6.6 crypto_xor(), crypto_xor_cpy(), and crypto_memneq() were
moved from crypto/algapi.h to a new crypto/utils.h header. For older
kernels, redirect to the original location.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/crypto/utils.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 backport/backport-include/crypto/utils.h

diff --git a/backport/backport-include/crypto/utils.h b/backport/backport-include/crypto/utils.h
new file mode 100644
index 00000000..7722b44a
--- /dev/null
+++ b/backport/backport-include/crypto/utils.h
@@ -0,0 +1,16 @@
+#ifndef __BACKPORT_CRYPTO_UTILS_H
+#define __BACKPORT_CRYPTO_UTILS_H
+#include <linux/version.h>
+
+/*
+ * In v6.6 crypto_xor(), crypto_xor_cpy(), and crypto_memneq() were
+ * moved from crypto/algapi.h to a new crypto/utils.h header.
+ * For older kernels, redirect to the original location.
+ */
+#if LINUX_VERSION_IS_LESS(6,6,0)
+#include <crypto/algapi.h>
+#else
+#include_next <crypto/utils.h>
+#endif
+
+#endif /* __BACKPORT_CRYPTO_UTILS_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 19/20] headers: add led_trigger_blink/oneshot value-to-pointer backport for kernels < 6.5
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
                   ` (17 preceding siblings ...)
  2026-06-24  7:38 ` [PATCH 18/20] headers: add crypto/utils.h redirect " Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  2026-06-24  7:38 ` [PATCH 20/20] headers: add of_property_present backport for kernels < 5.18 Yi Cong
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

In v6.5 led_trigger_blink() and led_trigger_blink_oneshot() changed
their delay_on/delay_off parameters from 'unsigned long *' to
'unsigned long'. mac80211/led.h and led.c call these with value
arguments (v6.5 style). For older kernels that still expect pointers,
provide wrappers that accept values and forward them via pointers to
the original functions.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/linux/leds.h | 39 ++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 backport/backport-include/linux/leds.h

diff --git a/backport/backport-include/linux/leds.h b/backport/backport-include/linux/leds.h
new file mode 100644
index 00000000..c922c5df
--- /dev/null
+++ b/backport/backport-include/linux/leds.h
@@ -0,0 +1,39 @@
+#ifndef __BACKPORT_LINUX_LEDS_H
+#define __BACKPORT_LINUX_LEDS_H
+#include_next <linux/leds.h>
+#include <linux/version.h>
+
+/*
+ * In v6.5 led_trigger_blink() and led_trigger_blink_oneshot() changed
+ * their delay_on/delay_off parameters from pointer to value:
+ *   v5.4: led_trigger_blink(trigger, unsigned long *delay_on, ...)
+ *   v6.5: led_trigger_blink(trigger, unsigned long delay_on, ...)
+ *
+ * mac80211/led.h and mac80211/led.c call these with value arguments
+ * (v6.5 style).  For older kernels that still expect pointers, provide
+ * wrappers that accept values and forward them via pointers.
+ */
+#if LINUX_VERSION_IS_LESS(6,5,0)
+#undef led_trigger_blink
+static inline void LINUX_BACKPORT(led_trigger_blink)(
+	struct led_trigger *trigger,
+	unsigned long delay_on,
+	unsigned long delay_off)
+{
+	led_trigger_blink(trigger, &delay_on, &delay_off);
+}
+#define led_trigger_blink LINUX_BACKPORT(led_trigger_blink)
+
+#undef led_trigger_blink_oneshot
+static inline void LINUX_BACKPORT(led_trigger_blink_oneshot)(
+	struct led_trigger *trigger,
+	unsigned long delay_on,
+	unsigned long delay_off,
+	int invert)
+{
+	led_trigger_blink_oneshot(trigger, &delay_on, &delay_off, invert);
+}
+#define led_trigger_blink_oneshot LINUX_BACKPORT(led_trigger_blink_oneshot)
+#endif
+
+#endif /* __BACKPORT_LINUX_LEDS_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 20/20] headers: add of_property_present backport for kernels < 5.18
  2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
                   ` (18 preceding siblings ...)
  2026-06-24  7:38 ` [PATCH 19/20] headers: add led_trigger_blink/oneshot value-to-pointer backport for kernels < 6.5 Yi Cong
@ 2026-06-24  7:38 ` Yi Cong
  19 siblings, 0 replies; 21+ messages in thread
From: Yi Cong @ 2026-06-24  7:38 UTC (permalink / raw)
  To: hauke, backports; +Cc: Yi Cong

From: Yi Cong <yicong@kylinos.cn>

of_property_present() was introduced in v5.18 as a wrapper around
of_property_read_bool(). This is needed when CONFIG_OF is enabled
(e.g. arm64, loongarch defconfigs) as brcmfmac/of.c uses it.

Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
 backport/backport-include/linux/of.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 backport/backport-include/linux/of.h

diff --git a/backport/backport-include/linux/of.h b/backport/backport-include/linux/of.h
new file mode 100644
index 00000000..7dc83e1f
--- /dev/null
+++ b/backport/backport-include/linux/of.h
@@ -0,0 +1,14 @@
+#ifndef __BACKPORT_LINUX_OF_H
+#define __BACKPORT_LINUX_OF_H
+#include_next <linux/of.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(5,18,0)
+static inline bool of_property_present(const struct device_node *np,
+				       const char *propname)
+{
+	return of_property_read_bool(np, propname);
+}
+#endif
+
+#endif /* __BACKPORT_LINUX_OF_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2026-06-24  7:40 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-24  7:38 [PATCH 00/20] backports: add missing backport-include header definitions Yi Cong
2026-06-24  7:38 ` [PATCH 01/20] headers: Add timer_shutdown_sync() Yi Cong
2026-06-24  7:38 ` [PATCH 02/20] headers: include linux/module.h from backport.h Yi Cong
2026-06-24  7:38 ` [PATCH 03/20] headers: add kstrtox.h backport Yi Cong
2026-06-24  7:38 ` [PATCH 04/20] headers: add get_random_u32_inclusive() for kernels < 6.2 Yi Cong
2026-06-24  7:38 ` [PATCH 05/20] headers: add genl_split_ops compat " Yi Cong
2026-06-24  7:38 ` [PATCH 06/20] headers: add thermal_zone_device_register_with_trips backport Yi Cong
2026-06-24  7:38 ` [PATCH 07/20] headers: add trace_sk_data_ready no-op for kernels < 6.0 Yi Cong
2026-06-24  7:38 ` [PATCH 08/20] headers: add dropreason-core.h backport for kernels < 5.17 Yi Cong
2026-06-24  7:38 ` [PATCH 09/20] headers: add dropreason.h backport for kernels < 6.0 Yi Cong
2026-06-24  7:38 ` [PATCH 10/20] headers: add kfree_skb_reason() backport for kernels < 5.17 Yi Cong
2026-06-24  7:38 ` [PATCH 11/20] headers: add thermal_zone_device_priv() backport for kernels < 6.4 Yi Cong
2026-06-24  7:38 ` [PATCH 12/20] headers: add genl_small_ops backport for kernels < 5.10 Yi Cong
2026-06-24  7:38 ` [PATCH 13/20] headers: add class_create() single-argument backport for kernels < 6.4 Yi Cong
2026-06-24  7:38 ` [PATCH 14/20] headers: add list_count_nodes() backport for kernels < 6.5 Yi Cong
2026-06-24  7:38 ` [PATCH 15/20] headers: add net/gso.h " Yi Cong
2026-06-24  7:38 ` [PATCH 16/20] headers: add vcalloc() backport for kernels < 5.18 Yi Cong
2026-06-24  7:38 ` [PATCH 17/20] headers: add __counted_by macro for kernels < 6.6 Yi Cong
2026-06-24  7:38 ` [PATCH 18/20] headers: add crypto/utils.h redirect " Yi Cong
2026-06-24  7:38 ` [PATCH 19/20] headers: add led_trigger_blink/oneshot value-to-pointer backport for kernels < 6.5 Yi Cong
2026-06-24  7:38 ` [PATCH 20/20] headers: add of_property_present backport for kernels < 5.18 Yi Cong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox