aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/subsys/072-backports-add-sched_set_fifo_low.patch
blob: 9b266ffcb3eedc71ae2eae2575e7c53b51798451 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From: Felix Fietkau <nbd@nbd.name>
Date: Mon, 28 Sep 2020 08:35:28 +0200
Subject: [PATCH] backports: add sched_set_fifo_low

It is needed for mt76

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 create mode 100644 backport/backport-include/linux/sched.h

--- /dev/null
+++ b/backport-include/linux/sched.h
@@ -0,0 +1,19 @@
+#ifndef __BACKPORT_LINUX_SCHED_H
+#define __BACKPORT_LINUX_SCHED_H
+
+#include_next <linux/sched.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(5,9,0)
+#include <uapi/linux/sched/types.h>
+
+static inline void sched_set_fifo_low(struct task_struct *p)
+{
+	struct sched_param sparam = {.sched_priority = 1};
+
+	sched_setscheduler(p, SCHED_FIFO, &sparam);
+}
+
+#endif
+
+#endif