Lines Matching refs:ctx_kern

52 	struct hid_bpf_ctx_kern ctx_kern = {  in dispatch_hid_bpf_device_event()  local
70 memset(ctx_kern.data, 0, hdev->bpf.allocated_data); in dispatch_hid_bpf_device_event()
71 memcpy(ctx_kern.data, data, *size); in dispatch_hid_bpf_device_event()
73 ret = hid_bpf_prog_run(hdev, HID_BPF_PROG_TYPE_DEVICE_EVENT, &ctx_kern); in dispatch_hid_bpf_device_event()
78 if (ret > ctx_kern.ctx.allocated_size) in dispatch_hid_bpf_device_event()
84 return ctx_kern.data; in dispatch_hid_bpf_device_event()
111 struct hid_bpf_ctx_kern ctx_kern = { in call_hid_bpf_rdesc_fixup() local
119 ctx_kern.data = kzalloc(ctx_kern.ctx.allocated_size, GFP_KERNEL); in call_hid_bpf_rdesc_fixup()
120 if (!ctx_kern.data) in call_hid_bpf_rdesc_fixup()
123 memcpy(ctx_kern.data, rdesc, min_t(unsigned int, *size, HID_MAX_DESCRIPTOR_SIZE)); in call_hid_bpf_rdesc_fixup()
125 ret = hid_bpf_prog_run(hdev, HID_BPF_PROG_TYPE_RDESC_FIXUP, &ctx_kern); in call_hid_bpf_rdesc_fixup()
130 if (ret > ctx_kern.ctx.allocated_size) in call_hid_bpf_rdesc_fixup()
136 rdesc = krealloc(ctx_kern.data, *size, GFP_KERNEL); in call_hid_bpf_rdesc_fixup()
141 kfree(ctx_kern.data); in call_hid_bpf_rdesc_fixup()
158 struct hid_bpf_ctx_kern *ctx_kern; in hid_bpf_get_data() local
163 ctx_kern = container_of(ctx, struct hid_bpf_ctx_kern, ctx); in hid_bpf_get_data()
168 return ctx_kern->data + offset; in hid_bpf_get_data()
313 struct hid_bpf_ctx_kern *ctx_kern = NULL; in hid_bpf_allocate_context() local
325 ctx_kern = kzalloc(sizeof(*ctx_kern), GFP_KERNEL); in hid_bpf_allocate_context()
326 if (!ctx_kern) in hid_bpf_allocate_context()
329 ctx_kern->ctx.hid = hdev; in hid_bpf_allocate_context()
331 return &ctx_kern->ctx; in hid_bpf_allocate_context()
343 struct hid_bpf_ctx_kern *ctx_kern; in hid_bpf_release_context() local
348 ctx_kern = container_of(ctx, struct hid_bpf_ctx_kern, ctx); in hid_bpf_release_context()
350 kfree(ctx_kern); in hid_bpf_release_context()