aboutsummaryrefslogtreecommitdiff
path: root/src/hid-tmff2.h
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-11-03 20:17:32 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2025-11-03 20:17:32 +0200
commit5095d47320c36e2346d41eb7e35dcbd215886557 (patch)
treea57f13d05f80e284967c2b3af4fb47f6404d83d1 /src/hid-tmff2.h
parent438a3e1407565dbd1d8ceb3981f4830a723a3c3c (diff)
downloadhid-tmff2-5095d47320c36e2346d41eb7e35dcbd215886557.tar.gz
hid-tmff2-5095d47320c36e2346d41eb7e35dcbd215886557.zip
minimize critical section in work handler
+ Effects handlers were being called in a locked context, which in this case happened to work due to how `hid_hw_request` is implemented. Now, only the selected state is updated and the heavy lifting of making the wheel aware of the requested changes is done after the critical section.
Diffstat (limited to 'src/hid-tmff2.h')
-rw-r--r--src/hid-tmff2.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/hid-tmff2.h b/src/hid-tmff2.h
index 666d249..f747f44 100644
--- a/src/hid-tmff2.h
+++ b/src/hid-tmff2.h
@@ -73,10 +73,10 @@ struct tmff2_device_entry {
signed short supported_effects[FF_CNT];
/* obligatory callbacks */
- int (*play_effect)(void *data, struct tmff2_effect_state *state);
- int (*upload_effect)(void *data, struct tmff2_effect_state *state);
- int (*update_effect)(void *data, struct tmff2_effect_state *state);
- int (*stop_effect)(void *data, struct tmff2_effect_state *state);
+ int (*play_effect)(void *data, const struct tmff2_effect_state *state);
+ int (*upload_effect)(void *data, const struct tmff2_effect_state *state);
+ int (*update_effect)(void *data, const struct tmff2_effect_state *state);
+ int (*stop_effect)(void *data, const struct tmff2_effect_state *state);
int (*wheel_init)(struct tmff2_device_entry *tmff2, int open_mode);
int (*wheel_destroy)(void *data);
@@ -134,10 +134,10 @@ struct t300rs_device_entry {
u8 *send_buffer;
};
-int t300rs_play_effect(void *, struct tmff2_effect_state *);
-int t300rs_upload_effect(void *, struct tmff2_effect_state *);
-int t300rs_update_effect(void *, struct tmff2_effect_state *);
-int t300rs_stop_effect(void *, struct tmff2_effect_state *);
+int t300rs_play_effect(void *, const struct tmff2_effect_state *);
+int t300rs_upload_effect(void *, const struct tmff2_effect_state *);
+int t300rs_update_effect(void *, const struct tmff2_effect_state *);
+int t300rs_stop_effect(void *, const struct tmff2_effect_state *);
int t300rs_open(void *, int);
int t300rs_close(void *, int);