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.
Showing the changes to include/uapi/linux (1 of 7 files). Show all
Unified · Split
| @@ -2301,6 +2301,20 @@ union bpf_attr { · 2300 unmodified lines | ||
| 2301 | 2301 | * payload and/or *pop* value being to large. |
| 2302 | 2302 | * Return |
| 2303 | 2303 | * 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 | |
| 2304 | 2318 | */ |
| 2305 | 2319 | #define __BPF_FUNC_MAPPER(FN) \ |
| 2306 | 2320 | FN(unspec), \ |
| @@ -2394,7 +2408,8 @@ union bpf_attr { · 87 unmodified lines | ||
| 2394 | 2408 | FN(map_pop_elem), \ |
| 2395 | 2409 | FN(map_peek_elem), \ |
| 2396 | 2410 | FN(msg_push_data), \ |
| 2397 | − FN(msg_pop_data), | |
| 2411 | + FN(msg_pop_data), \ | |
| 2412 | + FN(rc_pointer_rel), | |
| 2398 | 2413 | |
| 2399 | 2414 | /* integer value in 'imm' field of BPF_CALL instruction selects which helper |
| 2400 | 2415 | * function eBPF program intends to call |