aboutsummaryrefslogtreecommitdiffstats
path: root/utils/keytable/bpf_load.h
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2019-07-30 14:58:28 +0900
committerSean Young <sean@mess.org>2019-08-08 22:28:24 +0100
commit73f8f2f0acdce9f9ad91da9aa5390c5c7a6ddfd2 (patch)
tree81843410ad7837ed373aef3af1afb66a736adbb8 /utils/keytable/bpf_load.h
parent6aa15f7447d4aeca6af1ed7ee9644a0c7e891ece (diff)
keytable: add support for keymap with raw literals
These rc keymaps look like: [[protocols]] name = 'Beon_Colour_TV' protocol = 'raw' [[protocols.raw]] keycode = 'KEY_POWER' raw = [ 1324, 842, 6697, 26400, 1324, 842, 6697 ] [[protocols.raw]] keycode = 'KEY_MUTE' raw = [ 1305, 865, 2357, 931, 3411, 26400, 1305, 865, 2357, 931, 3411 ] So the incoming IR will be literally compared against the IR given, and only if the entire array matches with no leading or trailing IR will the keycode be reported. This is analogous to lircd raw_codes support, so lircd2toml.py can also convert raw_codes lircd.conf files. This means that the vast majority of lircd files can now be converted. This feature requires loops in BPF programs so this is only supported in kernel 5.3 onwards. Signed-off-by: Sean Young <sean@mess.org>
Diffstat (limited to 'utils/keytable/bpf_load.h')
-rw-r--r--utils/keytable/bpf_load.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/utils/keytable/bpf_load.h b/utils/keytable/bpf_load.h
index 2775607f..471600bb 100644
--- a/utils/keytable/bpf_load.h
+++ b/utils/keytable/bpf_load.h
@@ -24,6 +24,13 @@ struct bpf_map_data {
struct bpf_load_map_def def;
};
+struct raw_entry {
+ struct raw_entry *next;
+ u_int32_t scancode;
+ u_int32_t raw_length;
+ u_int32_t raw[1];
+};
+
/* parses elf file compiled by llvm .c->.o
* . parses 'maps' section and creates maps via BPF syscall
* . parses 'license' section and passes it to syscall
@@ -36,7 +43,7 @@ struct bpf_map_data {
*
* returns zero on success
*/
-int load_bpf_file(const char *path, int lirc_fd, struct toml_table_t *toml);
+int load_bpf_file(const char *path, int lirc_fd, struct toml_table_t *toml, struct raw_entry *raw);
int bpf_param(const char *name, int *val);

Privacy Policy