drm/modes: Fix drm_mode_vrefres() docs
[drm/drm-misc.git] / net / vmw_vsock / vmci_transport_notify.h
bloba1aa5a998c0e9462f62c945d05ac3d613a294761
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * VMware vSockets Driver
5 * Copyright (C) 2009-2013 VMware, Inc. All rights reserved.
6 */
8 #ifndef __VMCI_TRANSPORT_NOTIFY_H__
9 #define __VMCI_TRANSPORT_NOTIFY_H__
11 #include <linux/types.h>
12 #include <linux/vmw_vmci_defs.h>
13 #include <linux/vmw_vmci_api.h>
15 #include "vmci_transport.h"
17 /* Comment this out to compare with old protocol. */
18 #define VSOCK_OPTIMIZATION_WAITING_NOTIFY 1
19 #if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
20 /* Comment this out to remove flow control for "new" protocol */
21 #define VSOCK_OPTIMIZATION_FLOW_CONTROL 1
22 #endif
24 #define VMCI_TRANSPORT_MAX_DGRAM_RESENDS 10
26 struct vmci_transport_recv_notify_data {
27 u64 consume_head;
28 u64 produce_tail;
29 bool notify_on_block;
32 struct vmci_transport_send_notify_data {
33 u64 consume_head;
34 u64 produce_tail;
37 /* Socket notification callbacks. */
38 struct vmci_transport_notify_ops {
39 void (*socket_init) (struct sock *sk);
40 void (*socket_destruct) (struct vsock_sock *vsk);
41 int (*poll_in) (struct sock *sk, size_t target,
42 bool *data_ready_now);
43 int (*poll_out) (struct sock *sk, size_t target,
44 bool *space_avail_now);
45 void (*handle_notify_pkt) (struct sock *sk,
46 struct vmci_transport_packet *pkt,
47 bool bottom_half, struct sockaddr_vm *dst,
48 struct sockaddr_vm *src,
49 bool *pkt_processed);
50 int (*recv_init) (struct sock *sk, size_t target,
51 struct vmci_transport_recv_notify_data *data);
52 int (*recv_pre_block) (struct sock *sk, size_t target,
53 struct vmci_transport_recv_notify_data *data);
54 int (*recv_pre_dequeue) (struct sock *sk, size_t target,
55 struct vmci_transport_recv_notify_data *data);
56 int (*recv_post_dequeue) (struct sock *sk, size_t target,
57 ssize_t copied, bool data_read,
58 struct vmci_transport_recv_notify_data *data);
59 int (*send_init) (struct sock *sk,
60 struct vmci_transport_send_notify_data *data);
61 int (*send_pre_block) (struct sock *sk,
62 struct vmci_transport_send_notify_data *data);
63 int (*send_pre_enqueue) (struct sock *sk,
64 struct vmci_transport_send_notify_data *data);
65 int (*send_post_enqueue) (struct sock *sk, ssize_t written,
66 struct vmci_transport_send_notify_data *data);
67 void (*process_request) (struct sock *sk);
68 void (*process_negotiate) (struct sock *sk);
71 extern const struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops;
72 extern const
73 struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops;
75 #endif /* __VMCI_TRANSPORT_NOTIFY_H__ */