Skip to content

Commit 9dfea99

Browse files
committed
linuxPackages.morse-driver: init at 1.16.4
Add the morse Wi-Fi halow driver package version 1.16.4. Signed-off-by: Govind Singh <[email protected]>
1 parent 56b858a commit 9dfea99

File tree

3 files changed

+223
-0
lines changed

3 files changed

+223
-0
lines changed
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
From d144e153686e063ef3febeb3dbcaa5e98c3831ae Mon Sep 17 00:00:00 2001
2+
From: Govind Singh <[email protected]>
3+
Date: Thu, 6 Nov 2025 11:25:53 +0400
4+
Subject: [PATCH] fix build compatibility till Linux 6.12.3 with strict type
5+
checks
6+
7+
Signed-off-by: Govind Singh <[email protected]>
8+
---
9+
Makefile | 2 +-
10+
apf.c | 27 +++++++++++++++++++++++++++
11+
debug.h | 2 +-
12+
firmware.h | 4 +++-
13+
mac.c | 1 +
14+
morse.h | 2 +-
15+
vendor.c | 2 --
16+
7 files changed, 34 insertions(+), 6 deletions(-)
17+
18+
diff --git a/Makefile b/Makefile
19+
index 5dc7bb2..fce34ba 100644
20+
--- a/Makefile
21+
+++ b/Makefile
22+
@@ -155,6 +155,7 @@ morse-y += coredump.o
23+
morse-y += peer.o
24+
morse-y += led.o
25+
morse-y += bss_stats.o
26+
+morse-y += apf.o
27+
morse-$(CONFIG_MORSE_MONITOR) += monitor.o
28+
morse-$(CONFIG_MORSE_SDIO) += sdio.o
29+
morse-$(CONFIG_MORSE_SPI) += spi.o
30+
@@ -164,7 +165,6 @@ morse-$(CONFIG_MORSE_USER_ACCESS) += uaccess.o
31+
morse-$(CONFIG_MORSE_HW_TRACE) += hw_trace.o
32+
morse-$(CONFIG_MORSE_PAGESET_TRACE) += pageset_trace.o
33+
morse-$(CONFIG_MORSE_BUS_TRACE) += bus_trace.o
34+
-morse-$(CONFIG_ANDROID) += apf.o
35+
36+
ifeq ($(CONFIG_DISABLE_MORSE_RC),y)
37+
morse-y += minstrel_rc.o
38+
diff --git a/apf.c b/apf.c
39+
index baecd05..96b4b1b 100644
40+
--- a/apf.c
41+
+++ b/apf.c
42+
@@ -16,6 +16,7 @@
43+
#define MORSE_APF_WARN(_m, _f, _a...) morse_warn(FEATURE_ID_APF, _m, _f, ##_a)
44+
#define MORSE_APF_ERR(_m, _f, _a...) morse_err(FEATURE_ID_APF, _m, _f, ##_a)
45+
46+
+#ifdef CONFIG_ANDROID
47+
struct nla_policy morse_apf_nla_policy[VENDOR_ATTR_PACKET_FILTER_MAX] = {
48+
[VENDOR_ATTR_PACKET_FILTER_VERSION] = { .type = NLA_U32},
49+
[VENDOR_ATTR_PACKET_FILTER_MAX_LENGTH] = { .type = NLA_U32},
50+
@@ -210,3 +211,29 @@ exit:
51+
kfree(program);
52+
return ret;
53+
}
54+
+#else
55+
+int morse_vendor_cmd_get_supported_feature_set(struct wiphy *wiphy,
56+
+ struct wireless_dev *wdev, const void *data, int data_len)
57+
+{
58+
+ return -EOPNOTSUPP;
59+
+}
60+
+
61+
+int morse_vendor_cmd_apf_get_capabilities(struct wiphy *wiphy,
62+
+ struct wireless_dev *wdev, const void *data, int data_len)
63+
+{
64+
+ return -EOPNOTSUPP;
65+
+}
66+
+
67+
+int morse_vendor_cmd_apf_set_packet_filter(struct wiphy *wiphy,
68+
+ struct wireless_dev *wdev, const void *data, int data_len)
69+
+{
70+
+ return -EOPNOTSUPP;
71+
+}
72+
+
73+
+int morse_vendor_cmd_apf_read_packet_filter_data(struct wiphy *wiphy,
74+
+ struct wireless_dev *wdev, const void *data, int data_len)
75+
+{
76+
+ return -EOPNOTSUPP;
77+
+}
78+
+
79+
+#endif /* CONFIG_ANDROID */
80+
diff --git a/debug.h b/debug.h
81+
index 2b734d5..f03f419 100644
82+
--- a/debug.h
83+
+++ b/debug.h
84+
@@ -156,7 +156,7 @@ extern uint debug_mask;
85+
*
86+
* @returns True if output would be generated and false otherwise.
87+
*/
88+
-bool morse_log_is_enabled(u32 id, u8 level);
89+
+bool morse_log_is_enabled(enum morse_feature_id id, u8 level);
90+
91+
/**
92+
* Set the default logging level for all features.
93+
diff --git a/firmware.h b/firmware.h
94+
index 217339a..0b1815f 100644
95+
--- a/firmware.h
96+
+++ b/firmware.h
97+
@@ -32,6 +32,8 @@
98+
#error "Capability subset filled by firmware is to big"
99+
#endif
100+
101+
+enum morse_config_test_mode;
102+
+
103+
enum morse_fw_info_tlv_type {
104+
MORSE_FW_INFO_TLV_BCF_ADDR = 1,
105+
MORSE_FW_INFO_TLV_COREDUMP_MEM_REGION = 2,
106+
@@ -146,7 +148,7 @@ struct extended_host_table {
107+
u8 ext_host_table_data_tlvs[];
108+
} __packed;
109+
110+
-int morse_firmware_init(struct morse *mors, uint test_mode);
111+
+int morse_firmware_init(struct morse *mors, enum morse_config_test_mode test_mode);
112+
113+
/**
114+
* @brief Do necessary preparation and then initialise firmware
115+
diff --git a/mac.c b/mac.c
116+
index 7844af9..3b3595f 100644
117+
--- a/mac.c
118+
+++ b/mac.c
119+
@@ -4295,6 +4295,7 @@ static void morse_mac_ops_sta_rc_update(struct ieee80211_hw *hw,
120+
#else
121+
struct ieee80211_link_sta *link_sta,
122+
#endif
123+
+
124+
u32 changed)
125+
{
126+
struct morse *mors;
127+
diff --git a/morse.h b/morse.h
128+
index d001ab5..850587c 100644
129+
--- a/morse.h
130+
+++ b/morse.h
131+
@@ -55,7 +55,7 @@
132+
/* Re-Define the IGNORE channel flag, if not defined by the cfg80211 patch.
133+
* The flag won't be used by MM81xx.
134+
*/
135+
-#if defined(__x86_64__)
136+
+#ifndef IEEE80211_CHAN_IGNORE
137+
#define IEEE80211_CHAN_IGNORE IEEE80211_CHAN_DISABLED
138+
#endif
139+
140+
diff --git a/vendor.c b/vendor.c
141+
index 0556715..7fcd31a 100644
142+
--- a/vendor.c
143+
+++ b/vendor.c
144+
@@ -14,9 +14,7 @@
145+
#include "wiphy.h"
146+
#include "vendor.h"
147+
#include "mesh.h"
148+
-#ifdef CONFIG_ANDROID
149+
#include "apf.h"
150+
-#endif
151+
152+
/** Extra overhead to account for any additional netlink framing */
153+
#define VENDOR_EVENT_OVERHEAD (30)
154+
--
155+
2.34.1
156+
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
lib,
3+
stdenv,
4+
fetchFromGitHub,
5+
kernel,
6+
kernelModuleMakeFlags,
7+
}:
8+
9+
stdenv.mkDerivation {
10+
pname = "morse-driver";
11+
version = "1.16.4-${kernel.version}";
12+
13+
src = fetchFromGitHub {
14+
owner = "MorseMicro";
15+
repo = "morse_driver";
16+
rev = "7f95fe37750a09259b4d2988a9cf22df60f76fdf";
17+
hash = "sha256-kMEFl1sfDGqh96t5emF9UtzOqauFClKXBsXrS1NZ33E=";
18+
fetchSubmodules = true;
19+
};
20+
21+
patches = [
22+
./0001-fix-build-compatibility-till-Linux-6.12.3-with-stric.patch
23+
];
24+
25+
nativeBuildInputs = kernel.moduleBuildDependencies;
26+
27+
makeFlags =
28+
kernelModuleMakeFlags
29+
++ [
30+
"KERNEL_SRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
31+
32+
# --- Morse-specific Kconfig options ---
33+
"CONFIG_WLAN_VENDOR_MORSE=m"
34+
"CONFIG_MORSE_SDIO=y"
35+
"CONFIG_MORSE_SDIO_ALIGNMENT=4"
36+
"CONFIG_MORSE_USER_ACCESS=y"
37+
"CONFIG_MORSE_VENDOR_COMMAND=y"
38+
"CONFIG_MORSE_COUNTRY=US"
39+
"CONFIG_MORSE_DEBUG_MASK=4"
40+
"CONFIG_MORSE_SDIO_RESET_TIME=400"
41+
"CONFIG_MORSE_POWERSAVE_MODE=0"
42+
"CONFIG_ANDROID=n"
43+
"CONFIG_MORSE_WATCHDOG_RESET_DEFAULT_DISABLED=y"
44+
]
45+
++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
46+
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
47+
];
48+
49+
installPhase = ''
50+
mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
51+
install -D -m 644 morse.ko "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/morse.ko"
52+
install -D -m 644 dot11ah/dot11ah.ko "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/dot11ah.ko"
53+
'';
54+
55+
enableParallelBuilding = true;
56+
57+
meta = with lib; {
58+
description = "Morse Micro Wi-Fi driver";
59+
homepage = "https://github.com/MorseMicro/morse_driver";
60+
license = licenses.gpl2Only;
61+
platforms = platforms.linux;
62+
maintainers = with maintainers; [ govindsi ];
63+
broken = kernel.kernelOlder "6.1" || kernel.kernelAtLeast "6.12.56";
64+
};
65+
}

pkgs/top-level/linux-kernels.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,8 @@ in
580580

581581
mxu11x0 = callPackage ../os-specific/linux/mxu11x0 { };
582582

583+
morse-driver = callPackage ../os-specific/linux/morse-driver { };
584+
583585
# compiles but has to be integrated into the kernel somehow
584586
# Let's have it uncommented and finish it..
585587
ndiswrapper = callPackage ../os-specific/linux/ndiswrapper { };

0 commit comments

Comments
 (0)