#include <linux/bitops.h>
#include <linux/bpf_verifier.h>
#include <linux/bpf.h>
#include <linux/btf.h>
#include <linux/btf_ids.h>
#include <linux/filter.h>
#include <linux/hid.h>
#include <linux/hid_bpf.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/stddef.h>
#include <linux/workqueue.h>
#include "hid_bpf_dispatch.h"
static struct btf *hid_bpf_ops_btf;
static int hid_bpf_ops_init(struct btf *btf)
{ … }
static bool hid_bpf_ops_is_valid_access(int off, int size,
enum bpf_access_type type,
const struct bpf_prog *prog,
struct bpf_insn_access_aux *info)
{ … }
static int hid_bpf_ops_check_member(const struct btf_type *t,
const struct btf_member *member,
const struct bpf_prog *prog)
{ … }
struct hid_bpf_offset_write_range { … };
static int hid_bpf_ops_btf_struct_access(struct bpf_verifier_log *log,
const struct bpf_reg_state *reg,
int off, int size)
{ … }
static const struct bpf_verifier_ops hid_bpf_verifier_ops = …;
static int hid_bpf_ops_init_member(const struct btf_type *t,
const struct btf_member *member,
void *kdata, const void *udata)
{ … }
static int hid_bpf_reg(void *kdata, struct bpf_link *link)
{ … }
static void hid_bpf_unreg(void *kdata, struct bpf_link *link)
{ … }
static int __hid_bpf_device_event(struct hid_bpf_ctx *ctx, enum hid_report_type type, u64 source)
{ … }
static int __hid_bpf_rdesc_fixup(struct hid_bpf_ctx *ctx)
{ … }
static int __hid_bpf_hw_request(struct hid_bpf_ctx *ctx, unsigned char reportnum,
enum hid_report_type rtype, enum hid_class_request reqtype,
u64 source)
{ … }
static int __hid_bpf_hw_output_report(struct hid_bpf_ctx *ctx, u64 source)
{ … }
static struct hid_bpf_ops __bpf_hid_bpf_ops = …;
static struct bpf_struct_ops bpf_hid_bpf_ops = …;
void __hid_bpf_ops_destroy_device(struct hid_device *hdev)
{ … }
static int __init hid_bpf_struct_ops_init(void)
{ … }
late_initcall(hid_bpf_struct_ops_init);