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

« back to all changes in this revision

Viewing changes to modules/linux/shared/vmci_defs.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:
88
88
#define VMCI_INTR_DATAGRAM     0
89
89
#define VMCI_INTR_NOTIFICATION 1
90
90
 
 
91
 
 
92
/*
 
93
 * A single VMCI device has an upper limit of 128MB on the amount of
 
94
 * memory that can be used for queue pairs.
 
95
 */
 
96
#define VMCI_MAX_GUEST_QP_MEMORY (128 * 1024 * 1024)
 
97
 
91
98
/*
92
99
 * We have a fixed set of resource IDs available in the VMX.
93
100
 * This allows us to have a very simple implementation since we statically
116
123
 * WS 7.0/7.1 and ESX 4.1
117
124
 */
118
125
#define VMCI_HGFS_TRANSPORT       13
119
 
#define VMCI_RESOURCE_MAX         14
 
126
#define VMCI_UNITY_PBRPC_REGISTER 14
 
127
#define VMCI_RESOURCE_MAX         15
120
128
 
121
129
/* VMCI Ids. */
122
130
typedef uint32 VMCIId;
248
256
#define VMCI_SUCCESS_LAST_DETACH          3
249
257
#define VMCI_SUCCESS_ACCESS_GRANTED       2
250
258
#define VMCI_SUCCESS_ENTRY_DEAD           1
251
 
#define VMCI_SUCCESS                      0
 
259
#define VMCI_SUCCESS                      0LL
252
260
#define VMCI_ERROR_INVALID_RESOURCE      (-1)
253
261
#define VMCI_ERROR_INVALID_ARGS          (-2)
254
262
#define VMCI_ERROR_NO_MEM                (-3)
301
309
/* VMCI reserved events. */
302
310
typedef uint32 VMCI_Event;
303
311
 
304
 
#define VMCI_EVENT_CTX_ID_UPDATE  0
305
 
#define VMCI_EVENT_CTX_REMOVED    1
306
 
#define VMCI_EVENT_QP_RESUMED     2
307
 
#define VMCI_EVENT_QP_PEER_ATTACH 3
308
 
#define VMCI_EVENT_QP_PEER_DETACH 4
309
 
#define VMCI_EVENT_MAX            5
 
312
#define VMCI_EVENT_CTX_ID_UPDATE  0  // Only applicable to guest endpoints
 
313
#define VMCI_EVENT_CTX_REMOVED    1  // Applicable to guest and host
 
314
#define VMCI_EVENT_QP_RESUMED     2  // Only applicable to guest endpoints
 
315
#define VMCI_EVENT_QP_PEER_ATTACH 3  // Applicable to guest and host
 
316
#define VMCI_EVENT_QP_PEER_DETACH 4  // Applicable to guest and host
 
317
#define VMCI_EVENT_MEM_ACCESS_ON  5  // Only applicable to VMX endpoints
 
318
#define VMCI_EVENT_MEM_ACCESS_OFF 6  // Only applicable to VMX endpoints
 
319
#define VMCI_EVENT_MAX            7
 
320
 
 
321
/*
 
322
 * Of the above events, a few are reserved for use in the VMX, and
 
323
 * other endpoints (guest and host kernel) should not use them. For
 
324
 * the rest of the events, we allow both host and guest endpoints to
 
325
 * subscribe to them, to maintain the same API for host and guest
 
326
 * endpoints.
 
327
 */
 
328
 
 
329
#define VMCI_EVENT_VALID_VMX(_event) (_event == VMCI_EVENT_MEM_ACCESS_ON || \
 
330
                                      _event == VMCI_EVENT_MEM_ACCESS_OFF)
 
331
 
 
332
#define VMCI_EVENT_VALID(_event) (_event < VMCI_EVENT_MAX && \
 
333
                                  !VMCI_EVENT_VALID_VMX(_event))
310
334
 
311
335
/* Reserved guest datagram resource ids. */
312
336
#define VMCI_EVENT_HANDLER 0
338
362
#define VMCI_LEAST_PRIVILEGE_FLAGS         VMCI_PRIVILEGE_FLAG_RESTRICTED
339
363
#define VMCI_MAX_PRIVILEGE_FLAGS           VMCI_PRIVILEGE_FLAG_TRUSTED
340
364
 
341
 
/* VMCI Discovery Service. */
342
 
 
343
 
/* Well-known handle to the discovery service. */
344
 
#define VMCI_DS_RESOURCE_ID 1 /* Reserved resource ID for discovery service. */
345
 
#define VMCI_DS_HANDLE VMCI_MAKE_HANDLE(VMCI_WELL_KNOWN_CONTEXT_ID, \
346
 
                                        VMCI_DS_RESOURCE_ID)
347
 
#define VMCI_DS_CONTEXT VMCI_MAKE_HANDLE(VMCI_WELL_KNOWN_CONTEXT_ID, \
348
 
                                         VMCI_CONTEXT_RESOURCE_ID)
349
 
 
350
 
/* Maximum length of a DS message. */
351
 
#define VMCI_DS_MAX_MSG_SIZE        300
352
 
 
353
 
/* Command actions. */
354
 
#define VMCI_DS_ACTION_LOOKUP         0
355
 
#define VMCI_DS_ACTION_REGISTER       1
356
 
#define VMCI_DS_ACTION_UNREGISTER     2
357
 
 
358
 
/* Defines wire-protocol format for a request send to the DS from a context. */
359
 
typedef struct VMCIDsRequestHeader {
360
 
   int32       action;
361
 
   int32       msgid;
362
 
   VMCIHandle  handle;
363
 
   int32       nameLen;
364
 
   char        name[1];
365
 
} VMCIDsRequestHeader;
366
 
 
367
 
 
368
 
/* Defines the wire-protocol format for a request send from the DS to a context. */
369
 
typedef struct VMCIDsReplyHeader {
370
 
   int32       msgid;
371
 
   int32       code;
372
 
   VMCIHandle  handle;
373
 
   int32       msgLen;
374
 
   int8        msg[1];
375
 
} VMCIDsReplyHeader;
376
 
 
377
365
#define VMCI_PUBLIC_GROUP_NAME "vmci public group"
378
366
/* 0 through VMCI_RESERVED_RESOURCE_ID_MAX are reserved. */
379
367
#define VMCI_RESERVED_RESOURCE_ID_MAX 1023