Lines Matching refs:ctx_kern

29 	struct hid_bpf_ctx_kern ctx_kern = {  in dispatch_hid_bpf_device_event()  local
51 memset(ctx_kern.data, 0, hdev->bpf.allocated_data); in dispatch_hid_bpf_device_event()
52 memcpy(ctx_kern.data, data, *size); in dispatch_hid_bpf_device_event()
57 ret = e->hid_device_event(&ctx_kern.ctx, type, source); in dispatch_hid_bpf_device_event()
64 ctx_kern.ctx.size = ret; in dispatch_hid_bpf_device_event()
69 ret = ctx_kern.ctx.size; in dispatch_hid_bpf_device_event()
71 if (ret > ctx_kern.ctx.allocated_size) in dispatch_hid_bpf_device_event()
77 return ctx_kern.data; in dispatch_hid_bpf_device_event()
87 struct hid_bpf_ctx_kern ctx_kern = { in dispatch_hid_bpf_raw_requests() local
111 ret = e->hid_hw_request(&ctx_kern.ctx, reportnum, rtype, reqtype, source); in dispatch_hid_bpf_raw_requests()
127 struct hid_bpf_ctx_kern ctx_kern = { in dispatch_hid_bpf_output_report() local
148 ret = e->hid_hw_output_report(&ctx_kern.ctx, source); in dispatch_hid_bpf_output_report()
163 struct hid_bpf_ctx_kern ctx_kern = { in call_hid_bpf_rdesc_fixup() local
174 ctx_kern.data = kzalloc(ctx_kern.ctx.allocated_size, GFP_KERNEL); in call_hid_bpf_rdesc_fixup()
175 if (!ctx_kern.data) in call_hid_bpf_rdesc_fixup()
178 memcpy(ctx_kern.data, rdesc, min_t(unsigned int, *size, HID_MAX_DESCRIPTOR_SIZE)); in call_hid_bpf_rdesc_fixup()
180 ret = hdev->bpf.rdesc_ops->hid_rdesc_fixup(&ctx_kern.ctx); in call_hid_bpf_rdesc_fixup()
185 if (ret > ctx_kern.ctx.allocated_size) in call_hid_bpf_rdesc_fixup()
191 return krealloc(ctx_kern.data, *size, GFP_KERNEL); in call_hid_bpf_rdesc_fixup()
194 kfree(ctx_kern.data); in call_hid_bpf_rdesc_fixup()
296 struct hid_bpf_ctx_kern *ctx_kern; in hid_bpf_get_data() local
301 ctx_kern = container_of(ctx, struct hid_bpf_ctx_kern, ctx); in hid_bpf_get_data()
306 return ctx_kern->data + offset; in hid_bpf_get_data()
320 struct hid_bpf_ctx_kern *ctx_kern = NULL; in hid_bpf_allocate_context() local
326 ctx_kern = kzalloc(sizeof(*ctx_kern), GFP_KERNEL); in hid_bpf_allocate_context()
327 if (!ctx_kern) { in hid_bpf_allocate_context()
332 ctx_kern->ctx.hid = hdev; in hid_bpf_allocate_context()
334 return &ctx_kern->ctx; in hid_bpf_allocate_context()
346 struct hid_bpf_ctx_kern *ctx_kern; in hid_bpf_release_context() local
349 ctx_kern = container_of(ctx, struct hid_bpf_ctx_kern, ctx); in hid_bpf_release_context()
350 hid = (struct hid_device *)ctx_kern->ctx.hid; /* ignore const */ in hid_bpf_release_context()
352 kfree(ctx_kern); in hid_bpf_release_context()
410 struct hid_bpf_ctx_kern *ctx_kern; in hid_bpf_hw_request() local
415 ctx_kern = container_of(ctx, struct hid_bpf_ctx_kern, ctx); in hid_bpf_hw_request()
417 if (ctx_kern->from_bpf) in hid_bpf_hw_request()
469 struct hid_bpf_ctx_kern *ctx_kern; in hid_bpf_hw_output_report() local
474 ctx_kern = container_of(ctx, struct hid_bpf_ctx_kern, ctx); in hid_bpf_hw_output_report()
475 if (ctx_kern->from_bpf) in hid_bpf_hw_output_report()
497 struct hid_bpf_ctx_kern *ctx_kern; in __hid_bpf_input_report() local
500 ctx_kern = container_of(ctx, struct hid_bpf_ctx_kern, ctx); in __hid_bpf_input_report()
501 if (ctx_kern->from_bpf) in __hid_bpf_input_report()
528 struct hid_bpf_ctx_kern *ctx_kern; in hid_bpf_try_input_report() local
531 ctx_kern = container_of(ctx, struct hid_bpf_ctx_kern, ctx); in hid_bpf_try_input_report()
532 from_hid_event_hook = ctx_kern->data && ctx_kern->data == ctx->hid->bpf.device_data; in hid_bpf_try_input_report()