blob: fdba575f04b65fd4b8cc929a6a0e2fef64b4c370 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From 182391a3c96ff6ad79bbba0758338a16a66abbd8 Mon Sep 17 00:00:00 2001
2From: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
3Date: Wed, 12 Feb 2020 14:18:58 +0800
4Subject: [PATCH] Fix driver loading with backports 5.3+
5
6Commit 747796b2f126 did not solve the issue that it crashes when an older kernel
7with a newer backport tries loading it, because it only detects kernel version.
8
9As net/cfg80211.h in 5.3+ defines VENDOR_CMD_RAW_DATA, use it as a condition.
10
11Signed-off-by: DENG Qingfang <dqfext@gmail.com>
12---
13 vendor_cmd.c | 4 ++--
14 1 file changed, 2 insertions(+), 2 deletions(-)
15
16--- a/vendor_cmd.c
17+++ b/vendor_cmd.c
18@@ -92,7 +92,7 @@ static const struct wiphy_vendor_command
19 .subcmd = MWL_VENDOR_CMD_SET_BF_TYPE},
20 .flags = WIPHY_VENDOR_CMD_NEED_NETDEV,
21 .doit = mwl_vendor_cmd_set_bf_type,
22-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0))
23+#ifdef VENDOR_CMD_RAW_DATA
24 .policy = mwl_vendor_attr_policy,
25 #endif
26 },
27@@ -101,7 +101,7 @@ static const struct wiphy_vendor_command
28 .subcmd = MWL_VENDOR_CMD_GET_BF_TYPE},
29 .flags = WIPHY_VENDOR_CMD_NEED_NETDEV,
30 .doit = mwl_vendor_cmd_get_bf_type,
31-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0))
32+#ifdef VENDOR_CMD_RAW_DATA
33 .policy = mwl_vendor_attr_policy,
34 #endif
35 }