path: root/utils/keytable/bpf_load.h
AgeCommit message (Collapse)AuthorFilesLines
2021-01-13Build with libbpf, remove local sourcesLuca Boccassi1-2/+0
libbpf is nowadays widely available in all distros that enable BPF, and it is a standalone library with a release cycle and a stable API. Remove the old sync of bpf.c/bpf.h and check for the library via pkg-config and use it instead. Only a minor modification is needed to make it compile. Signed-off-by: Luca Boccassi <bluca@debian.org> Signed-off-by: Sean Young <sean@mess.org>
2019-08-27keytable: move keymap parsing into its own fileSean Young1-2/+2
We would like to reuse keymap parsing for transmitting IR based on keymap in ir-ctl. This also reduces the size of our huge keytable.c, and keeps knowledge toml localised to the keymap parser. Signed-off-by: Sean Young <sean@mess.org>
2019-08-11keytable: fix build on ubuntuSean Young1-7/+0
Signed-off-by: Sean Young <sean@mess.org>
2019-08-08keytable: add support for keymap with raw literalsSean Young1-1/+8
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>
2018-08-13keytable: add toml keymap readerSean Young1-1/+1
We would like to define BPF based IR protocols from rc_keymaps. We will need per-protocol parameters, so we need a more flexible format than the existing plain-text format. At some point in the future it would nice to change rc-core keycode mapping to protocol + 64 bit scancode -> keycode, rather the existing 32 bit scancode -> keycode. In order to make this possible, we want the scancodes to be specified for their protocol, in case multiple protocols are selected. Signed-off-by: Sean Young <sean@mess.org>
2018-08-13keytable: add support for BPF based protocolsSean Young1-0/+43
We use a modified version of samples/bpf/bpf_load.c from the linux kernel tree to load elf based BPF protocols and display the BPF program names. Any global int variables can be overrided from the command line. The immediate values are patched in the BPF LD instructions. Write a BPF protocol decoder in C, and compile with: clang -O2 -c --target=bpf foo.c Now you can load the object file like so: ir-keytable -p foo.o -v Any parameters can be specified using -e name=value. Signed-off-by: Sean Young <sean@mess.org>

Privacy Policy