Lines Matching refs:bpf
32 .allocated_size = hdev->bpf.allocated_data, in dispatch_hid_bpf_device_event()
35 .data = hdev->bpf.device_data, in dispatch_hid_bpf_device_event()
41 if (unlikely(hdev->bpf.destroyed)) in dispatch_hid_bpf_device_event()
48 if (!hdev->bpf.device_data) in dispatch_hid_bpf_device_event()
51 memset(ctx_kern.data, 0, hdev->bpf.allocated_data); in dispatch_hid_bpf_device_event()
55 list_for_each_entry_rcu(e, &hdev->bpf.prog_list, list) { in dispatch_hid_bpf_device_event()
99 if (unlikely(hdev->bpf.destroyed)) in dispatch_hid_bpf_raw_requests()
105 idx = srcu_read_lock(&hdev->bpf.srcu); in dispatch_hid_bpf_raw_requests()
106 list_for_each_entry_srcu(e, &hdev->bpf.prog_list, list, in dispatch_hid_bpf_raw_requests()
107 srcu_read_lock_held(&hdev->bpf.srcu)) { in dispatch_hid_bpf_raw_requests()
118 srcu_read_unlock(&hdev->bpf.srcu, idx); in dispatch_hid_bpf_raw_requests()
139 if (unlikely(hdev->bpf.destroyed)) in dispatch_hid_bpf_output_report()
142 idx = srcu_read_lock(&hdev->bpf.srcu); in dispatch_hid_bpf_output_report()
143 list_for_each_entry_srcu(e, &hdev->bpf.prog_list, list, in dispatch_hid_bpf_output_report()
144 srcu_read_lock_held(&hdev->bpf.srcu)) { in dispatch_hid_bpf_output_report()
155 srcu_read_unlock(&hdev->bpf.srcu, idx); in dispatch_hid_bpf_output_report()
171 if (!hdev->bpf.rdesc_ops) in call_hid_bpf_rdesc_fixup()
180 ret = hdev->bpf.rdesc_ops->hid_rdesc_fixup(&ctx_kern.ctx); in call_hid_bpf_rdesc_fixup()
264 if (hdev->bpf.device_data) in hid_bpf_allocate_event_data()
267 return __hid_bpf_allocate_data(hdev, &hdev->bpf.device_data, &hdev->bpf.allocated_data); in hid_bpf_allocate_event_data()
532 from_hid_event_hook = ctx_kern->data && ctx_kern->data == ctx->hid->bpf.device_data; in hid_bpf_try_input_report()
607 list_for_each_entry_rcu(e, &hdev->bpf.prog_list, list) { in hid_bpf_connect_device()
625 kfree(hdev->bpf.device_data); in hid_bpf_disconnect_device()
626 hdev->bpf.device_data = NULL; in hid_bpf_disconnect_device()
627 hdev->bpf.allocated_data = 0; in hid_bpf_disconnect_device()
637 hdev->bpf.destroyed = true; in hid_bpf_destroy_device()
641 synchronize_srcu(&hdev->bpf.srcu); in hid_bpf_destroy_device()
642 cleanup_srcu_struct(&hdev->bpf.srcu); in hid_bpf_destroy_device()
648 INIT_LIST_HEAD(&hdev->bpf.prog_list); in hid_bpf_device_init()
649 mutex_init(&hdev->bpf.prog_list_lock); in hid_bpf_device_init()
650 return init_srcu_struct(&hdev->bpf.srcu); in hid_bpf_device_init()