Thread (73 messages) 73 messages, 7 authors, 2022-03-15

Re: [PATCH bpf-next v2 02/28] bpf: introduce hid program type

flat view

From: Song Liu <song@kernel.org>
Date: 2022-03-05 00:21:04
Also in: bpf, linux-input, linux-kselftest, lkml

On Fri, Mar 4, 2022 at 9:31 AM Benjamin Tissoires
[off-list ref] wrote:
[...]
quoted hunk ↗ jump to hunk
+#endif
+
+static inline bool bpf_hid_link_empty(struct bpf_hid *bpf,
+                                     enum bpf_hid_attach_type type)
+{
+       return list_empty(&bpf->links[type]);
+}
+
+struct bpf_hid_hooks {
+       struct hid_device *(*hdev_from_fd)(int fd);
+       int (*link_attach)(struct hid_device *hdev, enum bpf_hid_attach_type type);
+       void (*array_detached)(struct hid_device *hdev, enum bpf_hid_attach_type type);
shall we call this array_detach()? detached sounds like a function that
checks the status of link/hook.

[...]
quoted hunk ↗ jump to hunk
--- /dev/null
+++ b/kernel/bpf/hid.c
@@ -0,0 +1,437 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * based on kernel/bpf/net-namespace.c
+ */
I guess we don't need this comment.
quoted hunk ↗ jump to hunk
+
+#include <linux/bpf.h>
+#include <linux/bpf-hid.h>
+#include <linux/filter.h>
+#include <linux/hid.h>
+#include <linux/hidraw.h>
[...]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help