History

media: bpf: add bpf function to report mouse movement

Some IR remotes have a directional pad or other pointer-like thing that can be used as a mouse. Make it possible to decode these types of IR protocols in BPF.

Sean Young committed 7 years ago

Commit 01d32401 parent ca5d1a77 files · +109 −23Browse files

Showing the changes to include/uapi/linux (1 of 7 files). Show all

Unified · Split

include/uapi/linux/bpf.h+16−1
@@ -2301,6 +2301,20 @@ union bpf_attr { · 2300 unmodified lines
23012301 * payload and/or *pop* value being to large.
23022302 * Return
23032303 * 0 on success, or a negative error in case of failure.
2304+ *
2305+ * int bpf_rc_pointer_rel(void *ctx, s32 rel_x, s32 rel_y)
2306+ * Description
2307+ * This helper is used in programs implementing IR decoding, to
2308+ * report a successfully decoded pointer movement.
2309+ *
2310+ * The *ctx* should point to the lirc sample as passed into
2311+ * the program.
2312+ *
2313+ * This helper is only available is the kernel was compiled with
2314+ * the **CONFIG_BPF_LIRC_MODE2** configuration option set to
2315+ * "**y**".
2316+ * Return
2317+ * 0
23042318 */
23052319 #define __BPF_FUNC_MAPPER(FN) \
23062320 FN(unspec), \
@@ -2394,7 +2408,8 @@ union bpf_attr { · 87 unmodified lines
23942408 FN(map_pop_elem), \
23952409 FN(map_peek_elem), \
23962410 FN(msg_push_data), \
2397− FN(msg_pop_data),
2411+ FN(msg_pop_data), \
2412+ FN(rc_pointer_rel),
23982413
23992414 /* integer value in 'imm' field of BPF_CALL instruction selects which helper
24002415 * function eBPF program intends to call