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

« back to all changes in this revision

Viewing changes to modules/linux/shared/vmciKernelAPI1.h

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-03-31 14:20:05 UTC
  • mfrom: (1.4.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110331142005-3n9red91p7ogkweo
Tags: 2011.03.28-387002-0ubuntu1
* Merge latest upstream git tag.  This has the unlocked_ioctl change
  needed to fix dkms build failures (LP: #727342)
* Changes in debian/rules:
  - work around a bug in toolbox/Makefile, where install-exec-hook is
    not happening.  This needs to get fixed the right way.
  - don't install 'vmware-user' which seems to no longer exist
  - move /etc/xdg into open-vm-toolbox (which should be done using .install)
* debian/open-vm-tools.init: add 'modprobe [-r] vmblock'. (LP: #332323)
* debian/rules and debian/open-vm-toolbox.lintian-overrides:
  - Make vmware-user-suid-wrapper suid-root (LP: #332323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*********************************************************
 
2
 * Copyright (C) 2010 VMware, Inc. All rights reserved.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify it
 
5
 * under the terms of the GNU General Public License as published by the
 
6
 * Free Software Foundation version 2 and no later version.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but
 
9
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
10
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 
11
 * for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License along
 
14
 * with this program; if not, write to the Free Software Foundation, Inc.,
 
15
 * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
16
 *
 
17
 *********************************************************/
 
18
 
 
19
/*
 
20
 * vmciKernelAPI1.h --
 
21
 *
 
22
 *    Kernel API (v1) exported from the VMCI host and guest drivers.
 
23
 */
 
24
 
 
25
#ifndef __VMCI_KERNELAPI_1_H__
 
26
#define __VMCI_KERNELAPI_1_H__
 
27
 
 
28
#define INCLUDE_ALLOW_MODULE
 
29
#define INCLUDE_ALLOW_VMK_MODULE
 
30
#define INCLUDE_ALLOW_VMKERNEL
 
31
#include "includeCheck.h"
 
32
 
 
33
#include "vmci_defs.h"
 
34
#include "vmci_call_defs.h"
 
35
 
 
36
 
 
37
/* VMCI module namespace on vmkernel. */
 
38
 
 
39
#define MOD_VMCI_NAMESPACE "com.vmware.vmci"
 
40
 
 
41
/* Define version 1. */
 
42
 
 
43
#undef  VMCI_KERNEL_API_VERSION
 
44
#define VMCI_KERNEL_API_VERSION_1 1
 
45
#define VMCI_KERNEL_API_VERSION   VMCI_KERNEL_API_VERSION_1
 
46
 
 
47
/* Macros to operate on the driver version number. */
 
48
 
 
49
#define VMCI_MAJOR_VERSION(v) (((v) >> 16) & 0xffff)
 
50
#define VMCI_MINOR_VERSION(v) ((v) & 0xffff)
 
51
 
 
52
/* VMCI Device Usage API. */
 
53
 
 
54
Bool VMCI_DeviceGet(uint32 *apiVersion);
 
55
void VMCI_DeviceRelease(void);
 
56
 
 
57
/* VMCI Datagram API. */
 
58
 
 
59
int VMCIDatagram_CreateHnd(VMCIId resourceID, uint32 flags,
 
60
                           VMCIDatagramRecvCB recvCB, void *clientData,
 
61
                           VMCIHandle *outHandle);
 
62
int VMCIDatagram_CreateHndPriv(VMCIId resourceID, uint32 flags,
 
63
                               VMCIPrivilegeFlags privFlags,
 
64
                               VMCIDatagramRecvCB recvCB, void *clientData,
 
65
                               VMCIHandle *outHandle);
 
66
int VMCIDatagram_DestroyHnd(VMCIHandle handle);
 
67
int VMCIDatagram_Send(VMCIDatagram *msg);
 
68
 
 
69
/* VMCI Utility API. */
 
70
 
 
71
VMCIId VMCI_GetContextID(void);
 
72
uint32 VMCI_Version(void);
 
73
int VMCI_ContextID2HostVmID(VMCIId contextID, void *hostVmID,
 
74
                            size_t hostVmIDLen);
 
75
int VMCI_IsContextOwner(VMCIId contextID, void *hostUser);
 
76
 
 
77
/* VMCI Event API. */
 
78
 
 
79
typedef void (*VMCI_EventCB)(VMCIId subID, VMCI_EventData *ed,
 
80
                             void *clientData);
 
81
 
 
82
int VMCIEvent_Subscribe(VMCI_Event event, uint32 flags, VMCI_EventCB callback,
 
83
                        void *callbackData, VMCIId *subID);
 
84
int VMCIEvent_Unsubscribe(VMCIId subID);
 
85
 
 
86
/* VMCI Context API */
 
87
 
 
88
VMCIPrivilegeFlags VMCIContext_GetPrivFlags(VMCIId contextID);
 
89
 
 
90
/* VMCI Queue Pair API. */
 
91
 
 
92
typedef struct VMCIQPair VMCIQPair;
 
93
 
 
94
int VMCIQPair_Alloc(VMCIQPair **qpair,
 
95
                    VMCIHandle *handle,
 
96
                    uint64 produceQSize,
 
97
                    uint64 consumeQSize,
 
98
                    VMCIId peer,
 
99
                    uint32 flags,
 
100
                    VMCIPrivilegeFlags privFlags);
 
101
 
 
102
int VMCIQPair_Detach(VMCIQPair **qpair);
 
103
 
 
104
int VMCIQPair_GetProduceIndexes(const VMCIQPair *qpair,
 
105
                                uint64 *producerTail,
 
106
                                uint64 *consumerHead);
 
107
int VMCIQPair_GetConsumeIndexes(const VMCIQPair *qpair,
 
108
                                uint64 *consumerTail,
 
109
                                uint64 *producerHead);
 
110
int64 VMCIQPair_ProduceFreeSpace(const VMCIQPair *qpair);
 
111
int64 VMCIQPair_ProduceBufReady(const VMCIQPair *qpair);
 
112
int64 VMCIQPair_ConsumeFreeSpace(const VMCIQPair *qpair);
 
113
int64 VMCIQPair_ConsumeBufReady(const VMCIQPair *qpair);
 
114
ssize_t VMCIQPair_Enqueue(VMCIQPair *qpair,
 
115
                          const void *buf,
 
116
                          size_t bufSize,
 
117
                          int mode);
 
118
ssize_t VMCIQPair_Dequeue(VMCIQPair *qpair,
 
119
                          void *buf,
 
120
                          size_t bufSize,
 
121
                          int mode);
 
122
ssize_t VMCIQPair_Peek(VMCIQPair *qpair,
 
123
                       void *buf,
 
124
                       size_t bufSize,
 
125
                       int mode);
 
126
 
 
127
#if defined (SOLARIS) || (defined(__APPLE__) && !defined (VMX86_TOOLS)) || \
 
128
    (defined(__linux__) && defined(__KERNEL__)) || \
 
129
    (defined(_WIN32) && defined(WINNT_DDK))
 
130
/*
 
131
 * Environments that support struct iovec
 
132
 */
 
133
 
 
134
ssize_t VMCIQPair_EnqueueV(VMCIQPair *qpair,
 
135
                           void *iov,
 
136
                           size_t iovSize,
 
137
                           int mode);
 
138
ssize_t VMCIQPair_DequeueV(VMCIQPair *qpair,
 
139
                           void *iov,
 
140
                           size_t iovSize,
 
141
                           int mode);
 
142
ssize_t VMCIQPair_PeekV(VMCIQPair *qpair,
 
143
                        void *iov,
 
144
                        size_t iovSize,
 
145
                        int mode);
 
146
#endif /* Systems that support struct iovec */
 
147
 
 
148
 
 
149
/* Typedefs for all of the above, used by the IOCTLs and the kernel library. */
 
150
 
 
151
typedef void (VMCI_DeviceReleaseFct)(void);
 
152
typedef int (VMCIDatagram_CreateHndFct)(VMCIId, uint32, VMCIDatagramRecvCB,
 
153
                                        void *, VMCIHandle *);
 
154
typedef int (VMCIDatagram_CreateHndPrivFct)(VMCIId, uint32, VMCIPrivilegeFlags,
 
155
                                            VMCIDatagramRecvCB, void *,
 
156
                                            VMCIHandle *);
 
157
typedef int (VMCIDatagram_DestroyHndFct)(VMCIHandle);
 
158
typedef int (VMCIDatagram_SendFct)(VMCIDatagram *);
 
159
typedef VMCIId (VMCI_GetContextIDFct)(void);
 
160
typedef uint32 (VMCI_VersionFct)(void);
 
161
typedef int (VMCIEvent_SubscribeFct)(VMCI_Event, uint32, VMCI_EventCB, void *,
 
162
                                     VMCIId *);
 
163
typedef int (VMCIEvent_UnsubscribeFct)(VMCIId);
 
164
typedef int (VMCIQPair_AllocFct)(VMCIQPair **, VMCIHandle *, uint64, uint64,
 
165
                                 VMCIId, uint32, VMCIPrivilegeFlags);
 
166
typedef int (VMCIQPair_DetachFct)(VMCIQPair **);
 
167
typedef int (VMCIQPair_GetProduceIndexesFct)(const VMCIQPair *, uint64 *,
 
168
                                             uint64 *);
 
169
typedef int (VMCIQPair_GetConsumeIndexesFct)(const VMCIQPair *, uint64 *,
 
170
                                             uint64 *);
 
171
typedef int64 (VMCIQPair_ProduceFreeSpaceFct)(const VMCIQPair *);
 
172
typedef int64 (VMCIQPair_ProduceBufReadyFct)(const VMCIQPair *);
 
173
typedef int64 (VMCIQPair_ConsumeFreeSpaceFct)(const VMCIQPair *);
 
174
typedef int64 (VMCIQPair_ConsumeBufReadyFct)(const VMCIQPair *);
 
175
typedef ssize_t (VMCIQPair_EnqueueFct)(VMCIQPair *, const void *, size_t, int);
 
176
typedef ssize_t (VMCIQPair_DequeueFct)(VMCIQPair *, void *, size_t, int);
 
177
typedef ssize_t (VMCIQPair_PeekFct)(VMCIQPair *, void *, size_t, int);
 
178
typedef ssize_t (VMCIQPair_EnqueueVFct)(VMCIQPair *qpair, void *, size_t, int);
 
179
typedef ssize_t (VMCIQPair_DequeueVFct)(VMCIQPair *qpair, void *, size_t, int);
 
180
typedef ssize_t (VMCIQPair_PeekVFct)(VMCIQPair *qpair, void *, size_t, int);
 
181
 
 
182
 
 
183
#endif /* !__VMCI_KERNELAPI_1_H__ */
 
184