~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201207201942

« back to all changes in this revision

Viewing changes to modules/linux/vsock/linux/notify.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-10-18 12:28:19 UTC
  • mfrom: (1.1.7 upstream) (2.4.9 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091018122819-00vqew6m0ztpqcqp
Tags: 2009.10.15-201664-1
MergingĀ upstreamĀ versionĀ 2009.10.15-201664.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#  define VSOCK_OPTIMIZATION_FLOW_CONTROL 1
37
37
#endif
38
38
 
 
39
#define VSOCK_MAX_DGRAM_RESENDS       10
 
40
 
39
41
#define NOTIFYCALLRET(vsk, rv, mod_fn, args...)                     \
40
42
do {                                                                \
41
 
  if (vsk->notifyOps->mod_fn != NULL) {                             \
 
43
  if (vsk->notifyOps &&                                             \
 
44
      vsk->notifyOps->mod_fn != NULL) {                             \
42
45
        rv = (vsk->notifyOps->mod_fn)(args);                        \
43
46
  } else {                                                          \
44
47
        rv = 0;                                                     \
47
50
 
48
51
#define NOTIFYCALL(vsk, mod_fn, args...)                            \
49
52
do {                                                                \
50
 
  if (vsk->notifyOps->mod_fn != NULL) {                             \
 
53
  if (vsk->notifyOps &&                                             \
 
54
      vsk->notifyOps->mod_fn != NULL) {                             \
51
55
        (vsk->notifyOps->mod_fn)(args);                             \
52
56
  }                                                                 \
53
57
} while (0)
54
58
 
55
 
 
56
 
typedef struct VSockVmciNotify {
 
59
typedef struct VSockVmciNotifyPkt {
57
60
   uint64 writeNotifyWindow;
58
61
   uint64 writeNotifyMinWindow;
59
62
   Bool peerWaitingRead;
65
68
   VSockWaitingInfo peerWaitingWriteInfo;
66
69
   uint64 produceQGeneration;
67
70
   uint64 consumeQGeneration;
 
71
} VSockVmciNotifyPkt;
 
72
 
 
73
typedef struct VSockVmciNotifyPktQState {
 
74
   uint64 writeNotifyWindow;
 
75
   uint64 writeNotifyMinWindow;
 
76
   Bool peerWaitingWrite;
 
77
   Bool peerWaitingWriteDetected;
 
78
} VSockVmciNotifyPktQState;
 
79
 
 
80
typedef union VSockVmciNotify {
 
81
   VSockVmciNotifyPkt pkt;
 
82
   VSockVmciNotifyPktQState pktQState;
68
83
} VSockVmciNotify;
69
84
 
70
85
typedef struct VSockVmciRecvNotifyData {
71
 
#if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
72
86
   uint64 consumeHead;
73
87
   uint64 produceTail;
74
 
#ifdef VSOCK_OPTIMIZATION_FLOW_CONTROL
75
88
   Bool notifyOnBlock;
76
 
#endif
77
 
#endif
78
89
} VSockVmciRecvNotifyData;
79
90
 
80
91
typedef struct VSockVmciSendNotifyData {
81
 
#if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
82
92
   uint64 consumeHead;
83
93
   uint64 produceTail;
84
 
#endif
85
94
} VSockVmciSendNotifyData;
86
95
 
87
96
/* Socket notification callbacks. */
110
119
   int32 (*sendPostEnqueue)(struct sock *sk,
111
120
                            ssize_t written,
112
121
                            VSockVmciSendNotifyData *data);
 
122
   void  (*processRequest)(struct sock *sk);
 
123
   void  (*processNegotiate)(struct sock *sk);
113
124
} VSockVmciNotifyOps;
114
125
 
115
126
extern VSockVmciNotifyOps vSockVmciNotifyPktOps;
 
127
extern VSockVmciNotifyOps vSockVmciNotifyPktQStateOps;
116
128
 
117
129
#endif /* __NOTIFY_H__ */