aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--CMakeLists.txt1
-rw-r--r--fastmouse.patch263
-rw-r--r--src/fastmouse.h184
-rw-r--r--src/linux/hid-core.c2
-rw-r--r--src/linux/hid-input.c148
-rwxr-xr-xsrc/make_kernel.sh1
-rwxr-xr-xsrc/make_patch.sh4
8 files changed, 353 insertions, 251 deletions
diff --git a/.gitignore b/.gitignore
index bc3fba4..2b0f809 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,5 @@ compile_commands.json
_deps/
build/
CMakeFiles/
-linux/
src/Testing
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5c5b980..f280ed4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.14)
project(root)
+set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
diff --git a/fastmouse.patch b/fastmouse.patch
index d525668..7eb8e3b 100644
--- a/fastmouse.patch
+++ b/fastmouse.patch
@@ -1,57 +1,46 @@
-diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
-index 4497b50799db..5a64a10b06da 100644
---- a/drivers/hid/hid-core.c
-+++ b/drivers/hid/hid-core.c
-@@ -1680,6 +1680,8 @@ static void hid_process_report(struct hid_device *hid,
- unsigned int a;
- struct hid_field_entry *entry;
- struct hid_field *field;
-+ struct input_dev *fastmouse_dev = NULL;
+diff --git a/drivers/hid/fastmouse.h b/drivers/hid/fastmouse.h
+new file mode 100644
+index 000000000000..2383de88932f
+--- /dev/null
++++ b/drivers/hid/fastmouse.h
+@@ -0,0 +1,189 @@
++#ifndef FASTMOUSE_H_
++#define FASTMOUSE_H_
+
-
- /* first retrieve all incoming values in data */
- for (a = 0; a < report->maxfield; a++)
-@@ -1692,6 +1694,10 @@ static void hid_process_report(struct hid_device *hid,
- list) {
- field = entry->field;
-
-+ if (hid->type == HID_TYPE_USBMOUSE && field->hidinput) {
-+ fastmouse_dev = field->hidinput->input;
-+ }
++// Mock functionality and structs for user space unit tests.
++#ifndef __KERNEL__
++#include <climits>
+
- if (field->flags & HID_MAIN_ITEM_VARIABLE)
- hid_process_event(hid,
- field,
-@@ -1721,6 +1727,13 @@ static void hid_process_report(struct hid_device *hid,
- hid_input_array_field(hid, field, interrupt);
- }
- }
++typedef int __s32;
++struct input_dev {};
++enum event_type {
++ EV_REL,
++};
++enum movement_type {
++ REL_X,
++ REL_Y,
++};
++struct mouse_movement {
++ int x = 0;
++ int y = 0;
++};
++static struct mouse_movement movement = {
++ .x = 0,
++ .y = 0,
++};
++static void input_event(input_dev*, event_type, movement_type code, int value) {
++ movement.x += (code == REL_X) * value;
++ movement.y += (code == REL_Y) * value;
++}
++#endif
+
-+
-+ if (fastmouse_dev) {
-+ fastmouse_input_emit(fastmouse_dev);
-+ }
++extern void input_event_fastmouse_log(
++ struct input_dev*,
++ const unsigned int,
++ const unsigned int code,
++ __s32 value);
++extern void fastmouse_input_emit(struct input_dev *input);
+
-+
- }
-
- /*
-diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
-index 9d80635a91eb..56e1bb7b7023 100644
---- a/drivers/hid/hid-input.c
-+++ b/drivers/hid/hid-input.c
-@@ -14,6 +14,7 @@
- */
-
- #include <linux/module.h>
-+#include <linux/moduleparam.h>
- #include <linux/slab.h>
- #include <linux/kernel.h>
-
-@@ -1505,6 +1506,150 @@ static void hid_report_set_tool(struct hid_report *report, struct input_dev *inp
- report->tool = new_tool;
- }
-
+struct fastmouse_state {
+ int division;
+ long frame_x, frame_y;
@@ -62,6 +51,26 @@ index 9d80635a91eb..56e1bb7b7023 100644
+ long accel;
+ */
+};
++
++/* TODO (for accel)
++static unsigned __int128 i128_sqrt(const unsigned __int128 v) {
++ unsigned __int128 left = 0;
++ unsigned __int128 right = v;
++ while (left < right) {
++ const unsigned __int128 mid = left + ((right - left) / 2);
++ if (mid >= ~(u64)0 || mid * mid > v) {
++ right = mid;
++ } else if (mid * mid == v) {
++ return mid;
++ } else {
++ left = mid + 1;
++ }
++ }
++ return left != 0 ? left - 1 : 0;
++}
++*/
++
++#ifdef FASTMOUSE_IMPL
+static struct fastmouse_state fastmouse = {
+ .division = 1,
+ .frame_x = 0,
@@ -76,6 +85,39 @@ index 9d80635a91eb..56e1bb7b7023 100644
+ */
+};
+
++void input_event_fastmouse_log(
++ struct input_dev*,
++ const unsigned int,
++ const unsigned int code,
++ __s32 value) {
++ fastmouse.frame_x += (code == REL_X) * value;
++ fastmouse.frame_y += (code == REL_Y) * value;
++}
++
++void fastmouse_input_emit(struct input_dev *input) {
++ const long rise = fastmouse.rise / fastmouse.division;
++ const long run = fastmouse.run / fastmouse.division;
++
++ fastmouse.accum_x += fastmouse.frame_x * run - fastmouse.frame_y * rise;
++ fastmouse.accum_y += fastmouse.frame_x * rise + fastmouse.frame_y * run;
++
++ const long emit_x = fastmouse.accum_x / INT_MAX;
++ if (emit_x != 0) {
++ input_event(input, EV_REL, REL_X, (__s32)emit_x);
++ }
++ const long emit_y = fastmouse.accum_y / INT_MAX;
++ if (emit_y != 0) {
++ input_event(input, EV_REL, REL_Y, (__s32)emit_y);
++ }
++ fastmouse.accum_x %= INT_MAX;
++ fastmouse.accum_y %= INT_MAX;
++
++ fastmouse.frame_x = fastmouse.frame_y = 0;
++}
++
++#ifdef __KERNEL__
++#include <linux/moduleparam.h>
++
+static int set_division(const char *val, const struct kernel_param *kp) {
+ const int ret = kstrtoint(val, 0, &fastmouse.division);
+ if (ret != 0 || fastmouse.division <= 0) {
@@ -147,59 +189,82 @@ index 9d80635a91eb..56e1bb7b7023 100644
+module_param_cb(acceleration, &accel_ops, &fastmouse.accel, 0664);
+MODULE_PARM_DESC(acceleration, "Mouse acceleration (default: 1)");
+*/
++#endif
++#endif
+
-+static void input_event_fastmouse_log(
-+ struct input_dev *input,
-+ const unsigned int type,
-+ const unsigned int code,
-+ __s32 value) {
-+ fastmouse.frame_x += (code == REL_X) * value;
-+ fastmouse.frame_y += (code == REL_Y) * value;
-+}
++#endif
+\ No newline at end of file
+diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
+index 4497b50799db..9dc84229abe3 100644
+--- a/drivers/hid/hid-core.c
++++ b/drivers/hid/hid-core.c
+@@ -35,6 +35,8 @@
+
+ #include "hid-ids.h"
+
++#include "fastmouse.h"
+
-+/* TODO (for accel)
-+static unsigned __int128 i128_sqrt(const unsigned __int128 v) {
-+ unsigned __int128 left = 0;
-+ unsigned __int128 right = v;
-+ while (left < right) {
-+ const unsigned __int128 mid = left + ((right - left) / 2);
-+ if (mid >= ~(u64)0 || mid * mid > v) {
-+ right = mid;
-+ } else if (mid * mid == v) {
-+ return mid;
-+ } else {
-+ left = mid + 1;
-+ }
-+ }
-+ return left != 0 ? left - 1 : 0;
-+}
-+*/
+ /*
+ * Version Information
+ */
+@@ -1680,6 +1682,8 @@ static void hid_process_report(struct hid_device *hid,
+ unsigned int a;
+ struct hid_field_entry *entry;
+ struct hid_field *field;
++ struct input_dev *fastmouse_dev = NULL;
++
+
+ /* first retrieve all incoming values in data */
+ for (a = 0; a < report->maxfield; a++)
+@@ -1692,6 +1696,10 @@ static void hid_process_report(struct hid_device *hid,
+ list) {
+ field = entry->field;
+
++ if (hid->type == HID_TYPE_USBMOUSE && field->hidinput) {
++ fastmouse_dev = field->hidinput->input;
++ }
++
+ if (field->flags & HID_MAIN_ITEM_VARIABLE)
+ hid_process_event(hid,
+ field,
+@@ -1721,6 +1729,13 @@ static void hid_process_report(struct hid_device *hid,
+ hid_input_array_field(hid, field, interrupt);
+ }
+ }
+
-+void fastmouse_input_emit(struct input_dev *input) {
-+ const long rise = fastmouse.rise / fastmouse.division;
-+ const long run = fastmouse.run / fastmouse.division;
-+
-+ fastmouse.accum_x += fastmouse.frame_x * run - fastmouse.frame_y * rise;
-+ fastmouse.accum_y += fastmouse.frame_x * rise + fastmouse.frame_y * run;
+
-+ const long emit_x = fastmouse.accum_x / INT_MAX;
-+ if (emit_x != 0) {
-+ input_event(input, EV_REL, REL_X, emit_x);
-+ }
-+ const long emit_y = fastmouse.accum_y / INT_MAX;
-+ if (emit_y != 0) {
-+ input_event(input, EV_REL, REL_Y, emit_y);
++ if (fastmouse_dev) {
++ fastmouse_input_emit(fastmouse_dev);
+ }
-+ fastmouse.accum_x %= INT_MAX;
-+ fastmouse.accum_y %= INT_MAX;
++
+
-+ fastmouse.frame_x = fastmouse.frame_y = 0;
-+}
+ }
+
+ /*
+diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
+index 9d80635a91eb..552bb63b9906 100644
+--- a/drivers/hid/hid-input.c
++++ b/drivers/hid/hid-input.c
+@@ -22,6 +22,10 @@
+
+ #include "hid-ids.h"
+
++#define FASTMOUSE_IMPL
++#include "fastmouse.h"
++#undef FASTMOUSE_IMPL
++
+ #define unk KEY_UNKNOWN
+
+ static const unsigned char hid_keyboard[256] = {
+@@ -1505,6 +1509,7 @@ static void hid_report_set_tool(struct hid_report *report, struct input_dev *inp
+ report->tool = new_tool;
+ }
+
+
void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value)
{
struct input_dev *input;
-@@ -1713,7 +1858,12 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
+@@ -1713,7 +1718,12 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
(!test_bit(usage->code, input->key)) == value)
input_event(input, EV_MSC, MSC_SCAN, usage->hid);
@@ -213,15 +278,3 @@ index 9d80635a91eb..56e1bb7b7023 100644
if ((field->flags & HID_MAIN_ITEM_RELATIVE) &&
usage->type == EV_KEY && value) {
-diff --git a/include/linux/hid.h b/include/linux/hid.h
-index cdc0dc13c87f..8321d637b112 100644
---- a/include/linux/hid.h
-+++ b/include/linux/hid.h
-@@ -940,6 +940,7 @@ extern void hid_unregister_driver(struct hid_driver *);
- module_driver(__hid_driver, hid_register_driver, \
- hid_unregister_driver)
-
-+extern void fastmouse_input_emit(struct input_dev *input);
- extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
- extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report);
- extern int hidinput_connect(struct hid_device *hid, unsigned int force);
diff --git a/src/fastmouse.h b/src/fastmouse.h
index f1ee96a..2383de8 100644
--- a/src/fastmouse.h
+++ b/src/fastmouse.h
@@ -1,5 +1,189 @@
#ifndef FASTMOUSE_H_
#define FASTMOUSE_H_
+// Mock functionality and structs for user space unit tests.
+#ifndef __KERNEL__
+#include <climits>
+
+typedef int __s32;
+struct input_dev {};
+enum event_type {
+ EV_REL,
+};
+enum movement_type {
+ REL_X,
+ REL_Y,
+};
+struct mouse_movement {
+ int x = 0;
+ int y = 0;
+};
+static struct mouse_movement movement = {
+ .x = 0,
+ .y = 0,
+};
+static void input_event(input_dev*, event_type, movement_type code, int value) {
+ movement.x += (code == REL_X) * value;
+ movement.y += (code == REL_Y) * value;
+}
+#endif
+
+extern void input_event_fastmouse_log(
+ struct input_dev*,
+ const unsigned int,
+ const unsigned int code,
+ __s32 value);
+extern void fastmouse_input_emit(struct input_dev *input);
+
+struct fastmouse_state {
+ int division;
+ long frame_x, frame_y;
+ long accum_x, accum_y;
+ int rise, run;
+ /* TODO
+ int polling_rate;
+ long accel;
+ */
+};
+
+/* TODO (for accel)
+static unsigned __int128 i128_sqrt(const unsigned __int128 v) {
+ unsigned __int128 left = 0;
+ unsigned __int128 right = v;
+ while (left < right) {
+ const unsigned __int128 mid = left + ((right - left) / 2);
+ if (mid >= ~(u64)0 || mid * mid > v) {
+ right = mid;
+ } else if (mid * mid == v) {
+ return mid;
+ } else {
+ left = mid + 1;
+ }
+ }
+ return left != 0 ? left - 1 : 0;
+}
+*/
+
+#ifdef FASTMOUSE_IMPL
+static struct fastmouse_state fastmouse = {
+ .division = 1,
+ .frame_x = 0,
+ .frame_y = 0,
+ .accum_x = 0,
+ .accum_y = 0,
+ .rise = 0,
+ .run = INT_MAX,
+ /* TODO
+ .polling_rate = 4000,
+ .accel = 1,
+ */
+};
+
+void input_event_fastmouse_log(
+ struct input_dev*,
+ const unsigned int,
+ const unsigned int code,
+ __s32 value) {
+ fastmouse.frame_x += (code == REL_X) * value;
+ fastmouse.frame_y += (code == REL_Y) * value;
+}
+
+void fastmouse_input_emit(struct input_dev *input) {
+ const long rise = fastmouse.rise / fastmouse.division;
+ const long run = fastmouse.run / fastmouse.division;
+
+ fastmouse.accum_x += fastmouse.frame_x * run - fastmouse.frame_y * rise;
+ fastmouse.accum_y += fastmouse.frame_x * rise + fastmouse.frame_y * run;
+
+ const long emit_x = fastmouse.accum_x / INT_MAX;
+ if (emit_x != 0) {
+ input_event(input, EV_REL, REL_X, (__s32)emit_x);
+ }
+ const long emit_y = fastmouse.accum_y / INT_MAX;
+ if (emit_y != 0) {
+ input_event(input, EV_REL, REL_Y, (__s32)emit_y);
+ }
+ fastmouse.accum_x %= INT_MAX;
+ fastmouse.accum_y %= INT_MAX;
+
+ fastmouse.frame_x = fastmouse.frame_y = 0;
+}
+
+#ifdef __KERNEL__
+#include <linux/moduleparam.h>
+
+static int set_division(const char *val, const struct kernel_param *kp) {
+ const int ret = kstrtoint(val, 0, &fastmouse.division);
+ if (ret != 0 || fastmouse.division <= 0) {
+ return -EINVAL;
+ }
+ return ret;
+}
+static const struct kernel_param_ops division_ops = {
+ .set = set_division,
+ .get = param_get_int,
+};
+module_param_cb(division, &division_ops, &fastmouse.division, 0664);
+MODULE_PARM_DESC(division, "Mouse movement division amount (default: 1)");
+
+static int set_rise(const char *val, const struct kernel_param *kp) {
+ const int ret = kstrtoint(val, 0, &fastmouse.rise);
+ if (ret != 0) {
+ return -EINVAL;
+ }
+ return ret;
+}
+static const struct kernel_param_ops rise_ops = {
+ .set = set_rise,
+ .get = param_get_int,
+};
+module_param_cb(rise, &rise_ops, &fastmouse.rise, 0664);
+MODULE_PARM_DESC(rise, "Mouse movement rise amount (default: 0)");
+
+static int set_run(const char *val, const struct kernel_param *kp) {
+ const int ret = kstrtoint(val, 0, &fastmouse.run);
+ if (ret != 0) {
+ return -EINVAL;
+ }
+ return ret;
+}
+static const struct kernel_param_ops run_ops = {
+ .set = set_run,
+ .get = param_get_int,
+};
+module_param_cb(run, &run_ops, &fastmouse.run, 0664);
+MODULE_PARM_DESC(run, "Mouse movement run amount (default: INT_MAX)");
+
+/* TODO
+static int set_polling_rate(const char *val, const struct kernel_param *kp) {
+ const int ret = kstrtoint(val, 0, &fastmouse.polling_rate);
+ if (ret != 0) {
+ return -EINVAL;
+ }
+ return ret;
+}
+static const struct kernel_param_ops poll_ops = {
+ .set = set_polling_rate,
+ .get = param_get_int,
+};
+module_param_cb(polling_rate, &poll_ops, &fastmouse.polling_rate, 0664);
+MODULE_PARM_DESC(polling_rate, "Mouse polling rate (default: 4000)");
+
+static int set_accel(const char *val, const struct kernel_param *kp) {
+ const int ret = kstrtol(val, 0, &fastmouse.accel);
+ if (ret != 0) {
+ return -EINVAL;
+ }
+ return ret;
+}
+static const struct kernel_param_ops accel_ops = {
+ .set = set_accel,
+ .get = param_get_int,
+};
+module_param_cb(acceleration, &accel_ops, &fastmouse.accel, 0664);
+MODULE_PARM_DESC(acceleration, "Mouse acceleration (default: 1)");
+*/
+#endif
+#endif
#endif \ No newline at end of file
diff --git a/src/linux/hid-core.c b/src/linux/hid-core.c
index 5a64a10..9dc8422 100644
--- a/src/linux/hid-core.c
+++ b/src/linux/hid-core.c
@@ -35,6 +35,8 @@
#include "hid-ids.h"
+#include "fastmouse.h"
+
/*
* Version Information
*/
diff --git a/src/linux/hid-input.c b/src/linux/hid-input.c
index 56e1bb7..552bb63 100644
--- a/src/linux/hid-input.c
+++ b/src/linux/hid-input.c
@@ -14,7 +14,6 @@
*/
#include <linux/module.h>
-#include <linux/moduleparam.h>
#include <linux/slab.h>
#include <linux/kernel.h>
@@ -23,6 +22,10 @@
#include "hid-ids.h"
+#define FASTMOUSE_IMPL
+#include "fastmouse.h"
+#undef FASTMOUSE_IMPL
+
#define unk KEY_UNKNOWN
static const unsigned char hid_keyboard[256] = {
@@ -1506,149 +1509,6 @@ static void hid_report_set_tool(struct hid_report *report, struct input_dev *inp
report->tool = new_tool;
}
-struct fastmouse_state {
- int division;
- long frame_x, frame_y;
- long accum_x, accum_y;
- int rise, run;
- /* TODO
- int polling_rate;
- long accel;
- */
-};
-static struct fastmouse_state fastmouse = {
- .division = 1,
- .frame_x = 0,
- .frame_y = 0,
- .accum_x = 0,
- .accum_y = 0,
- .rise = 0,
- .run = INT_MAX,
- /* TODO
- .polling_rate = 4000,
- .accel = 1,
- */
-};
-
-static int set_division(const char *val, const struct kernel_param *kp) {
- const int ret = kstrtoint(val, 0, &fastmouse.division);
- if (ret != 0 || fastmouse.division <= 0) {
- return -EINVAL;
- }
- return ret;
-}
-static const struct kernel_param_ops division_ops = {
- .set = set_division,
- .get = param_get_int,
-};
-module_param_cb(division, &division_ops, &fastmouse.division, 0664);
-MODULE_PARM_DESC(division, "Mouse movement division amount (default: 1)");
-
-static int set_rise(const char *val, const struct kernel_param *kp) {
- const int ret = kstrtoint(val, 0, &fastmouse.rise);
- if (ret != 0) {
- return -EINVAL;
- }
- return ret;
-}
-static const struct kernel_param_ops rise_ops = {
- .set = set_rise,
- .get = param_get_int,
-};
-module_param_cb(rise, &rise_ops, &fastmouse.rise, 0664);
-MODULE_PARM_DESC(rise, "Mouse movement rise amount (default: 0)");
-
-static int set_run(const char *val, const struct kernel_param *kp) {
- const int ret = kstrtoint(val, 0, &fastmouse.run);
- if (ret != 0) {
- return -EINVAL;
- }
- return ret;
-}
-static const struct kernel_param_ops run_ops = {
- .set = set_run,
- .get = param_get_int,
-};
-module_param_cb(run, &run_ops, &fastmouse.run, 0664);
-MODULE_PARM_DESC(run, "Mouse movement run amount (default: INT_MAX)");
-
-/* TODO
-static int set_polling_rate(const char *val, const struct kernel_param *kp) {
- const int ret = kstrtoint(val, 0, &fastmouse.polling_rate);
- if (ret != 0) {
- return -EINVAL;
- }
- return ret;
-}
-static const struct kernel_param_ops poll_ops = {
- .set = set_polling_rate,
- .get = param_get_int,
-};
-module_param_cb(polling_rate, &poll_ops, &fastmouse.polling_rate, 0664);
-MODULE_PARM_DESC(polling_rate, "Mouse polling rate (default: 4000)");
-
-static int set_accel(const char *val, const struct kernel_param *kp) {
- const int ret = kstrtol(val, 0, &fastmouse.accel);
- if (ret != 0) {
- return -EINVAL;
- }
- return ret;
-}
-static const struct kernel_param_ops accel_ops = {
- .set = set_accel,
- .get = param_get_int,
-};
-module_param_cb(acceleration, &accel_ops, &fastmouse.accel, 0664);
-MODULE_PARM_DESC(acceleration, "Mouse acceleration (default: 1)");
-*/
-
-static void input_event_fastmouse_log(
- struct input_dev *input,
- const unsigned int type,
- const unsigned int code,
- __s32 value) {
- fastmouse.frame_x += (code == REL_X) * value;
- fastmouse.frame_y += (code == REL_Y) * value;
-}
-
-/* TODO (for accel)
-static unsigned __int128 i128_sqrt(const unsigned __int128 v) {
- unsigned __int128 left = 0;
- unsigned __int128 right = v;
- while (left < right) {
- const unsigned __int128 mid = left + ((right - left) / 2);
- if (mid >= ~(u64)0 || mid * mid > v) {
- right = mid;
- } else if (mid * mid == v) {
- return mid;
- } else {
- left = mid + 1;
- }
- }
- return left != 0 ? left - 1 : 0;
-}
-*/
-
-void fastmouse_input_emit(struct input_dev *input) {
- const long rise = fastmouse.rise / fastmouse.division;
- const long run = fastmouse.run / fastmouse.division;
-
- fastmouse.accum_x += fastmouse.frame_x * run - fastmouse.frame_y * rise;
- fastmouse.accum_y += fastmouse.frame_x * rise + fastmouse.frame_y * run;
-
- const long emit_x = fastmouse.accum_x / INT_MAX;
- if (emit_x != 0) {
- input_event(input, EV_REL, REL_X, emit_x);
- }
- const long emit_y = fastmouse.accum_y / INT_MAX;
- if (emit_y != 0) {
- input_event(input, EV_REL, REL_Y, emit_y);
- }
- fastmouse.accum_x %= INT_MAX;
- fastmouse.accum_y %= INT_MAX;
-
- fastmouse.frame_x = fastmouse.frame_y = 0;
-}
void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value)
{
diff --git a/src/make_kernel.sh b/src/make_kernel.sh
index 8700351..64b3527 100755
--- a/src/make_kernel.sh
+++ b/src/make_kernel.sh
@@ -3,6 +3,7 @@
set -xe
cp ./src/linux/* ./linux/drivers/hid/
+cp ./src/fastmouse.h ./linux/drivers/hid/
cd ./linux
make -j$(nproc)
diff --git a/src/make_patch.sh b/src/make_patch.sh
index 58c946e..2aa27c0 100755
--- a/src/make_patch.sh
+++ b/src/make_patch.sh
@@ -3,7 +3,9 @@
set -xe
cp ./src/linux/* ./linux/drivers/hid/
+cp ./src/fastmouse.h ./linux/drivers/hid/
cd ./linux
+git add --intent-to-add ./drivers/hid/fastmouse.h
git diff > ../fastmouse.patch
-exit 0 \ No newline at end of file
+exit 0