]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
VMCI/VSOCK: Pt1. Switch to upstreamed Linux API
authorVMware, Inc <>
Fri, 12 Apr 2013 19:45:17 +0000 (12:45 -0700)
committerDmitry Torokhov <dtor@vmware.com>
Wed, 17 Apr 2013 19:16:52 +0000 (12:16 -0700)
This is the first part of a change to switch to the upstreamed Linux
API.  This change just flips the API names to match the upstreamed
versions.  A subsequent change will take care of fixing up the
parameters (we removed/changed some for upstreaming).

This change updates: VMCI, vSockets, the VMCI kernel lib on Windows,
the VMCI test driver, HGFS, dvFilter and vPageChannel.

It does NOT affect the user-mode VMCI API: there's no point, and it'd
be a waste of time changing all the tests.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
17 files changed:
open-vm-tools/modules/linux/shared/vmciKernelAPI1.h
open-vm-tools/modules/linux/shared/vmciKernelAPI2.h
open-vm-tools/modules/linux/vmci/common/vmciContext.c
open-vm-tools/modules/linux/vmci/common/vmciDatagram.c
open-vm-tools/modules/linux/vmci/common/vmciDoorbell.c
open-vm-tools/modules/linux/vmci/common/vmciDriver.c
open-vm-tools/modules/linux/vmci/common/vmciEvent.c
open-vm-tools/modules/linux/vmci/common/vmciPageChannel.c
open-vm-tools/modules/linux/vmci/common/vmciQPair.c
open-vm-tools/modules/linux/vmci/common/vmciQueuePair.c
open-vm-tools/modules/linux/vmci/common/vmciRoute.c
open-vm-tools/modules/linux/vmci/linux/vmci_version.h
open-vm-tools/modules/linux/vmhgfs/vmci.c
open-vm-tools/modules/linux/vsock/linux/af_vsock.c
open-vm-tools/modules/linux/vsock/linux/notify.c
open-vm-tools/modules/linux/vsock/linux/notifyQState.c
open-vm-tools/modules/linux/vsock/linux/vsock_version.h

index 0f88fc98ccd0ec8a40406a93a327494f6ffb6293..bf8a00de30902fc44ae311918f63cc8b732c9f38 100644 (file)
 typedef void (VMCI_DeviceShutdownFn)(void *deviceRegistration,
                                      void *userData);
 
-Bool VMCI_DeviceGet(uint32 *apiVersion, VMCI_DeviceShutdownFn *deviceShutdownCB,
-                    void *userData, void **deviceRegistration);
-void VMCI_DeviceRelease(void *deviceRegistration);
+Bool vmci_device_get(uint32 *apiVersion,
+                     VMCI_DeviceShutdownFn *deviceShutdownCB,
+                     void *userData, void **deviceRegistration);
+void vmci_device_release(void *deviceRegistration);
 
 #if defined(_WIN32)
 /* Called when the client is unloading, for Windows only. */
-void VMCI_Exit(void);
+void vmci_exit(void);
 #endif // _WIN32
 
 /* VMCI Datagram API. */
 
-int VMCIDatagram_CreateHnd(VMCIId resourceID, uint32 flags,
-                           VMCIDatagramRecvCB recvCB, void *clientData,
-                           VMCIHandle *outHandle);
-int VMCIDatagram_CreateHndPriv(VMCIId resourceID, uint32 flags,
-                               VMCIPrivilegeFlags privFlags,
-                               VMCIDatagramRecvCB recvCB, void *clientData,
-                               VMCIHandle *outHandle);
-int VMCIDatagram_DestroyHnd(VMCIHandle handle);
-int VMCIDatagram_Send(VMCIDatagram *msg);
+int vmci_datagram_create_handle(uint32 resourceId, uint32 flags,
+                                VMCIDatagramRecvCB recvCB, void *clientData,
+                                VMCIHandle *outHandle);
+int vmci_datagram_create_handle_priv(uint32 resourceID, uint32 flags,
+                                     VMCIPrivilegeFlags privFlags,
+                                     VMCIDatagramRecvCB recvCB,
+                                     void *clientData, VMCIHandle *outHandle);
+int vmci_datagram_destroy_handle(VMCIHandle handle);
+int vmci_datagram_send(VMCIDatagram *msg);
 
 /* VMCI Utility API. */
 
-VMCIId VMCI_GetContextID(void);
-uint32 VMCI_Version(void);
-int VMCI_ContextID2HostVmID(VMCIId contextID, void *hostVmID,
-                            size_t hostVmIDLen);
-int VMCI_IsContextOwner(VMCIId contextID, void *hostUser);
+VMCIId vmci_get_context_id(void);
+int vmci_is_context_owner(VMCIId contextID, void *hostUser);
+
+uint32 vmci_version(void);
+int vmci_cid_2_host_vm_id(VMCIId contextID, void *hostVmID,
+                          size_t hostVmIDLen);
 
 /* VMCI Event API. */
 
 typedef void (*VMCI_EventCB)(VMCIId subID, VMCI_EventData *ed,
                              void *clientData);
 
-int VMCIEvent_Subscribe(VMCI_Event event, uint32 flags, VMCI_EventCB callback,
-                        void *callbackData, VMCIId *subID);
-int VMCIEvent_Unsubscribe(VMCIId subID);
+int vmci_event_subscribe(VMCI_Event event, uint32 flags,
+                         VMCI_EventCB callback,
+                         void *callbackData, VMCIId *subID);
+int vmci_event_unsubscribe(VMCIId subID);
 
 /* VMCI Context API */
 
-VMCIPrivilegeFlags VMCIContext_GetPrivFlags(VMCIId contextID);
+VMCIPrivilegeFlags vmci_context_get_priv_flags(VMCIId contextID);
 
 /* VMCI Queue Pair API. */
 
 typedef struct VMCIQPair VMCIQPair;
 
-int VMCIQPair_Alloc(VMCIQPair **qpair,
-                    VMCIHandle *handle,
-                    uint64 produceQSize,
-                    uint64 consumeQSize,
-                    VMCIId peer,
-                    uint32 flags,
-                    VMCIPrivilegeFlags privFlags);
-
-int VMCIQPair_Detach(VMCIQPair **qpair);
-
-int VMCIQPair_GetProduceIndexes(const VMCIQPair *qpair,
-                                uint64 *producerTail,
-                                uint64 *consumerHead);
-int VMCIQPair_GetConsumeIndexes(const VMCIQPair *qpair,
-                                uint64 *consumerTail,
-                                uint64 *producerHead);
-int64 VMCIQPair_ProduceFreeSpace(const VMCIQPair *qpair);
-int64 VMCIQPair_ProduceBufReady(const VMCIQPair *qpair);
-int64 VMCIQPair_ConsumeFreeSpace(const VMCIQPair *qpair);
-int64 VMCIQPair_ConsumeBufReady(const VMCIQPair *qpair);
-ssize_t VMCIQPair_Enqueue(VMCIQPair *qpair,
-                          const void *buf,
-                          size_t bufSize,
-                          int mode);
-ssize_t VMCIQPair_Dequeue(VMCIQPair *qpair,
-                          void *buf,
-                          size_t bufSize,
-                          int mode);
-ssize_t VMCIQPair_Peek(VMCIQPair *qpair,
-                       void *buf,
-                       size_t bufSize,
-                       int mode);
+int vmci_qpair_alloc(VMCIQPair **qpair, VMCIHandle *handle,
+                     uint64 produceQSize, uint64 consumeQSize, VMCIId peer,
+                     uint32 flags, VMCIPrivilegeFlags privFlags);
+int vmci_qpair_detach(VMCIQPair **qpair);
+int vmci_qpair_get_produce_indexes(const VMCIQPair *qpair,
+                                   uint64 *producerTail, uint64 *consumerHead);
+int vmci_qpair_get_consume_indexes(const VMCIQPair *qpair,
+                                   uint64 *consumerTail, uint64 *producerHead);
+int64 vmci_qpair_produce_free_space(const VMCIQPair *qpair);
+int64 vmci_qpair_produce_buf_ready(const VMCIQPair *qpair);
+int64 vmci_qpair_consume_free_space(const VMCIQPair *qpair);
+int64 vmci_qpair_consume_buf_ready(const VMCIQPair *qpair);
+ssize_t vmci_qpair_enqueue(VMCIQPair *qpair, const void *buf, size_t bufSize,
+                           int mode);
+ssize_t vmci_qpair_dequeue(VMCIQPair *qpair, void *buf, size_t bufSize,
+                           int mode);
+ssize_t vmci_qpair_peek(VMCIQPair *qpair, void *buf, size_t bufSize, int mode);
 
 #if defined (SOLARIS) || (defined(__APPLE__) && !defined (VMX86_TOOLS)) || \
     (defined(__linux__) && defined(__KERNEL__)) || \
@@ -145,18 +133,12 @@ ssize_t VMCIQPair_Peek(VMCIQPair *qpair,
  * Environments that support struct iovec
  */
 
-ssize_t VMCIQPair_EnqueueV(VMCIQPair *qpair,
-                           void *iov,
-                           size_t iovSize,
-                           int mode);
-ssize_t VMCIQPair_DequeueV(VMCIQPair *qpair,
-                           void *iov,
-                           size_t iovSize,
-                           int mode);
-ssize_t VMCIQPair_PeekV(VMCIQPair *qpair,
-                        void *iov,
-                        size_t iovSize,
-                        int mode);
+ssize_t vmci_qpair_enquev(VMCIQPair *qpair, void *iov, size_t iovSize,
+                          int mode);
+ssize_t vmci_qpair_dequev(VMCIQPair *qpair, void *iov, size_t iovSize,
+                          int mode);
+ssize_t vmci_qpair_peekv(VMCIQPair *qpair, void *iov, size_t iovSize,
+                         int mode);
 #endif /* Systems that support struct iovec */
 
 
index 9622b840d848d57ce1ba70751b0511e110a4dce2..e7cb1f9acea78990f09640f9190eef15b06eb374 100644 (file)
 
 typedef void (*VMCICallback)(void *clientData);
 
-int VMCIDoorbell_Create(VMCIHandle *handle, uint32 flags,
-                        VMCIPrivilegeFlags privFlags,
-                        VMCICallback notifyCB, void *clientData);
-int VMCIDoorbell_Destroy(VMCIHandle handle);
-int VMCIDoorbell_Notify(VMCIHandle handle,
-                        VMCIPrivilegeFlags privFlags);
-
+int vmci_doorbell_create(VMCIHandle *handle, uint32 flags,
+                         VMCIPrivilegeFlags privFlags, VMCICallback notifyCB,
+                         void *clientData);
+int vmci_doorbell_destroy(VMCIHandle handle);
+int vmci_doorbell_notify(VMCIHandle handle, VMCIPrivilegeFlags privFlags);
 
 /* Typedefs for all of the above, used by the IOCTLs and the kernel library. */
 
@@ -64,4 +62,3 @@ typedef int (VMCIDoorbell_NotifyFct)(VMCIHandle, VMCIPrivilegeFlags);
 
 
 #endif /* !__VMCI_KERNELAPI_2_H__ */
-
index 207cec98799a2e822f80145bf4c086edc4e244e0..147098d446dc249bad5ff183ae257ef672ba44ee 100644 (file)
@@ -1256,7 +1256,7 @@ VMCIContext_GetId(VMCIContext *context) // IN:
 /*
  *----------------------------------------------------------------------
  *
- * VMCIContext_GetPrivFlags --
+ * vmci_context_get_priv_flags --
  *
  *      Retrieves the privilege flags of the given VMCI context ID.
  *
@@ -1269,9 +1269,9 @@ VMCIContext_GetId(VMCIContext *context) // IN:
  *----------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIContext_GetPrivFlags)
+VMCI_EXPORT_SYMBOL(vmci_context_get_priv_flags)
 VMCIPrivilegeFlags
-VMCIContext_GetPrivFlags(VMCIId contextID)  // IN
+vmci_context_get_priv_flags(VMCIId contextID)  // IN
 {
    if (VMCI_HostPersonalityActive()) {
       VMCIPrivilegeFlags flags;
@@ -1996,7 +1996,7 @@ VMCIContext_NotifyDoorbell(VMCIId srcCID,                   // IN
 
       if (srcCID != VMCI_HOST_CONTEXT_ID ||
           srcPrivFlags == VMCI_NO_PRIVILEGE_FLAGS) {
-         srcPrivFlags = VMCIContext_GetPrivFlags(srcCID);
+         srcPrivFlags = vmci_context_get_priv_flags(srcCID);
       }
 
       if (VMCIDenyInteraction(srcPrivFlags, dstPrivFlags)) {
@@ -2138,7 +2138,7 @@ VMCIContext_SignalPendingDatagrams(VMCIId contextID)
 /*
  *----------------------------------------------------------------------
  *
- * VMCI_ContextID2HostVmID --
+ * vmci_cid_2_host_vm_id --
  *
  *      Maps a context ID to the host specific (process/world) ID
  *      of the VM/VMX.
@@ -2152,11 +2152,11 @@ VMCIContext_SignalPendingDatagrams(VMCIId contextID)
  *----------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCI_ContextID2HostVmID)
+VMCI_EXPORT_SYMBOL(vmci_cid_2_host_vm_id)
 int
-VMCI_ContextID2HostVmID(VMCIId contextID,    // IN
-                        void *hostVmID,      // OUT
-                        size_t hostVmIDLen)  // IN
+vmci_cid_2_host_vm_id(VMCIId contextID,    // IN
+                      void *hostVmID,      // OUT
+                      size_t hostVmIDLen)  // IN
 {
 #if defined(VMKERNEL)
    VMCIContext *context;
@@ -2189,7 +2189,7 @@ VMCI_ContextID2HostVmID(VMCIId contextID,    // IN
 /*
  *----------------------------------------------------------------------
  *
- * VMCI_IsContextOwner --
+ * vmci_is_context_owner --
  *
  *      Determines whether a given host OS specific representation of
  *      user is the owner of the VM/VMX.
@@ -2203,10 +2203,10 @@ VMCI_ContextID2HostVmID(VMCIId contextID,    // IN
  *----------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCI_IsContextOwner)
+VMCI_EXPORT_SYMBOL(vmci_is_context_owner)
 int
-VMCI_IsContextOwner(VMCIId contextID,   // IN
-                    void *hostUser)     // IN
+vmci_is_context_owner(VMCIId contextID,   // IN
+                      void *hostUser)     // IN
 {
    if (VMCI_HostPersonalityActive()) {
       VMCIContext *context;
index 6c59e6a7ba58b7038c1ff9806d6d56ccf2cf9c14..0dbac6527af4e2dbaac06af416f25771ca7613f9 100644 (file)
@@ -166,7 +166,7 @@ DatagramCreateHnd(VMCIId resourceID,            // IN:
       if ((flags & VMCI_FLAG_ANYCID_DG_HND) != 0) {
          contextID = VMCI_INVALID_ID;
       } else {
-         contextID = VMCI_GetContextID();
+         contextID = vmci_get_context_id();
          if (contextID == VMCI_INVALID_ID) {
             return VMCI_ERROR_NO_RESOURCES;
          }
@@ -274,7 +274,7 @@ VMCIDatagram_Exit(void)
 /*
  *------------------------------------------------------------------------------
  *
- * VMCIDatagram_CreateHnd --
+ * vmci_datagram_create_handle --
  *
  *      Creates a host context datagram endpoint and returns a handle to it.
  *
@@ -287,14 +287,14 @@ VMCIDatagram_Exit(void)
  *------------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIDatagram_CreateHnd)
+VMCI_EXPORT_SYMBOL(vmci_datagram_create_handle)
 int
-VMCIDatagram_CreateHnd(VMCIId resourceID,          // IN: Optional, generated
-                                                   //     if VMCI_INVALID_ID
-                       uint32 flags,               // IN:
-                       VMCIDatagramRecvCB recvCB,  // IN:
-                       void *clientData,           // IN:
-                       VMCIHandle *outHandle)      // OUT: newly created handle
+vmci_datagram_create_handle(
+   VMCIId resourceID,         // IN: Optional, generated if VMCI_INVALID_ID
+   uint32 flags,              // IN:
+   VMCIDatagramRecvCB recvCB, // IN:
+   void *clientData,          // IN:
+   VMCIHandle *outHandle)     // OUT: newly created handle
 {
    if (outHandle == NULL) {
       return VMCI_ERROR_INVALID_ARGS;
@@ -314,7 +314,7 @@ VMCIDatagram_CreateHnd(VMCIId resourceID,          // IN: Optional, generated
 /*
  *------------------------------------------------------------------------------
  *
- * VMCIDatagram_CreateHndPriv --
+ * vmci_datagram_create_handle_priv --
  *
  *      Creates a host context datagram endpoint and returns a handle to it.
  *
@@ -327,15 +327,15 @@ VMCIDatagram_CreateHnd(VMCIId resourceID,          // IN: Optional, generated
  *------------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIDatagram_CreateHndPriv)
+VMCI_EXPORT_SYMBOL(vmci_datagram_create_handle_priv)
 int
-VMCIDatagram_CreateHndPriv(VMCIId resourceID,           // IN: Optional, generated
-                                                        //     if VMCI_INVALID_ID
-                           uint32 flags,                // IN:
-                           VMCIPrivilegeFlags privFlags,// IN:
-                           VMCIDatagramRecvCB recvCB,   // IN:
-                           void *clientData,            // IN:
-                           VMCIHandle *outHandle)       // OUT: newly created handle
+vmci_datagram_create_handle_priv(
+   VMCIId resourceID,            // IN: Optional, generated if VMCI_INVALID_ID
+   uint32 flags,                 // IN:
+   VMCIPrivilegeFlags privFlags, // IN:
+   VMCIDatagramRecvCB recvCB,    // IN:
+   void *clientData,             // IN:
+   VMCIHandle *outHandle)        // OUT: newly created handle
 {
    if (outHandle == NULL) {
       return VMCI_ERROR_INVALID_ARGS;
@@ -359,7 +359,7 @@ VMCIDatagram_CreateHndPriv(VMCIId resourceID,           // IN: Optional, generat
 /*
  *------------------------------------------------------------------------------
  *
- * VMCIDatagram_DestroyHnd --
+ * vmci_datagram_destroy_handle --
  *
  *      Destroys a handle.
  *
@@ -372,9 +372,9 @@ VMCIDatagram_CreateHndPriv(VMCIId resourceID,           // IN: Optional, generat
  *------------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIDatagram_DestroyHnd)
+VMCI_EXPORT_SYMBOL(vmci_datagram_destroy_handle)
 int
-VMCIDatagram_DestroyHnd(VMCIHandle handle)       // IN
+vmci_datagram_destroy_handle(VMCIHandle handle) // IN
 {
    DatagramEntry *entry;
    VMCIResource *resource = VMCIResource_Get(handle,
@@ -444,7 +444,7 @@ VMCIDatagramGetPrivFlagsInt(VMCIId contextID,              // IN
    } else if (contextID == VMCI_HYPERVISOR_CONTEXT_ID) {
       *privFlags = VMCI_MAX_PRIVILEGE_FLAGS;
    } else {
-      *privFlags = VMCIContext_GetPrivFlags(contextID);
+      *privFlags = vmci_context_get_priv_flags(contextID);
    }
 
    return VMCI_SUCCESS;
@@ -667,10 +667,11 @@ VMCIDatagramDispatchAsHost(VMCIId contextID,  // IN:
 
       if (contextID != dg->dst.context) {
          if (VMCIDenyInteraction(srcPrivFlags,
-                                 VMCIContext_GetPrivFlags(dg->dst.context))) {
+                              vmci_context_get_priv_flags(dg->dst.context))) {
             VMCI_DEBUG_LOG(4, (LGPFX"Interaction denied (%X/%X - %X/%X)\n",
                            contextID, srcPrivFlags,
-                           dg->dst.context, VMCIContext_GetPrivFlags(dg->dst.context)));
+                           dg->dst.context,
+                           vmci_context_get_priv_flags(dg->dst.context)));
             return VMCI_ERROR_NO_ACCESS;
          } else if (VMCI_CONTEXT_IS_VM(contextID)) {
             /*
@@ -892,7 +893,7 @@ exit:
 /*
  *------------------------------------------------------------------------------
  *
- * VMCIDatagram_Send --
+ * vmci_datagram_send --
  *
  *      Sends the payload to the destination datagram handle.
  *
@@ -905,9 +906,9 @@ exit:
  *------------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIDatagram_Send)
+VMCI_EXPORT_SYMBOL(vmci_datagram_send)
 int
-VMCIDatagram_Send(VMCIDatagram *msg) // IN
+vmci_datagram_send(VMCIDatagram *msg) // IN
 {
    if (msg == NULL) {
       return VMCI_ERROR_INVALID_ARGS;
index 3fa639c380aeb2bda0829adb254555ee3edfa428..74053e15587ddaa994bf144b7c84390744fb4d3c 100644 (file)
@@ -260,7 +260,7 @@ VMCIDoorbellGetPrivFlags(VMCIHandle handle,             // IN
        /* Hypervisor endpoints for notifications are not supported (yet). */
       return VMCI_ERROR_INVALID_ARGS;
    } else {
-      *privFlags = VMCIContext_GetPrivFlags(handle.context);
+      *privFlags = vmci_context_get_priv_flags(handle.context);
    }
 
    return VMCI_SUCCESS;
@@ -534,7 +534,7 @@ VMCIDoorbellUnlink(VMCIHandle handle, // IN
 /*
  *------------------------------------------------------------------------------
  *
- * VMCIDoorbell_Create --
+ * vmci_doorbell_create --
  *
  *    Creates a doorbell with the given callback. If the handle is
  *    VMCI_INVALID_HANDLE, a free handle will be assigned, if
@@ -554,13 +554,13 @@ VMCIDoorbellUnlink(VMCIHandle handle, // IN
  *------------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIDoorbell_Create)
+VMCI_EXPORT_SYMBOL(vmci_doorbell_create)
 int
-VMCIDoorbell_Create(VMCIHandle *handle,            // IN/OUT
-                    uint32 flags,                  // IN
-                    VMCIPrivilegeFlags privFlags,  // IN
-                    VMCICallback notifyCB,         // IN
-                    void *clientData)              // IN
+vmci_doorbell_create(VMCIHandle *handle,            // IN/OUT
+                     uint32 flags,                  // IN
+                     VMCIPrivilegeFlags privFlags,  // IN
+                     VMCICallback notifyCB,         // IN
+                     void *clientData)              // IN
 {
    VMCIDoorbellEntry *entry;
    VMCIHandle newHandle;
@@ -583,7 +583,7 @@ VMCIDoorbell_Create(VMCIHandle *handle,            // IN/OUT
    }
 
    if (VMCI_HANDLE_INVALID(*handle)) {
-      VMCIId contextID = VMCI_GetContextID();
+      VMCIId contextID = vmci_get_context_id();
       VMCIId resourceID = VMCIResource_GetID(contextID);
       if (resourceID == VMCI_INVALID_ID) {
          result = VMCI_ERROR_NO_HANDLE;
@@ -605,7 +605,8 @@ VMCIDoorbell_Create(VMCIHandle *handle,            // IN/OUT
       if (VMCI_HOST_CONTEXT_ID == handle->context) {
          validContext = TRUE;
       }
-      if (VMCI_GuestPersonalityActive() && VMCI_GetContextID() == handle->context) {
+      if (VMCI_GuestPersonalityActive() &&
+          vmci_get_context_id() == handle->context) {
          validContext = TRUE;
       }
 
@@ -669,10 +670,10 @@ freeMem:
 /*
  *------------------------------------------------------------------------------
  *
- * VMCIDoorbell_Destroy --
+ * vmci_doorbell_destroy --
  *
  *    Destroys a doorbell previously created with
- *    VMCIDoorbell_Create. This operation may block waiting for a
+ *    vmci_doorbell_create. This operation may block waiting for a
  *    callback to finish.
  *
  * Results:
@@ -684,9 +685,9 @@ freeMem:
  *------------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIDoorbell_Destroy)
+VMCI_EXPORT_SYMBOL(vmci_doorbell_destroy)
 int
-VMCIDoorbell_Destroy(VMCIHandle handle)  // IN
+vmci_doorbell_destroy(VMCIHandle handle)  // IN
 {
    VMCIDoorbellEntry *entry;
    VMCIResource *resource;
@@ -797,7 +798,7 @@ VMCIDoorbellNotifyAsGuest(VMCIHandle handle,            // IN
 /*
  *------------------------------------------------------------------------------
  *
- * VMCIDoorbell_Notify --
+ * vmci_doorbell_notify --
  *
  *    Generates a notification on the doorbell identified by the
  *    handle. For host side generation of notifications, the caller
@@ -812,10 +813,10 @@ VMCIDoorbellNotifyAsGuest(VMCIHandle handle,            // IN
  *------------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIDoorbell_Notify)
+VMCI_EXPORT_SYMBOL(vmci_doorbell_notify)
 int
-VMCIDoorbell_Notify(VMCIHandle dst,               // IN
-                    VMCIPrivilegeFlags privFlags) // IN
+vmci_doorbell_notify(VMCIHandle dst,               // IN
+                     VMCIPrivilegeFlags privFlags) // IN
 {
    int retval;
    VMCIRoute route;
index af29462e0461f2204cfa662c424fd9df83f826e3..73af8260e3fa9141c3c3880dcb2ad21f9df28842 100644 (file)
@@ -128,7 +128,7 @@ VMCI_HostCleanup(void)
 /*
  *----------------------------------------------------------------------
  *
- * VMCI_DeviceGet --
+ * vmci_device_get --
  *
  *      Verifies that a valid VMCI device is present, and indicates
  *      the callers intention to use the device until it calls
@@ -143,12 +143,12 @@ VMCI_HostCleanup(void)
  *----------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCI_DeviceGet)
+VMCI_EXPORT_SYMBOL(vmci_device_get)
 Bool
-VMCI_DeviceGet(uint32 *apiVersion,                      // IN/OUT
-               VMCI_DeviceShutdownFn *deviceShutdownCB, // UNUSED
-               void *userData,                          // UNUSED
-               void **deviceRegistration)               // OUT
+vmci_device_get(uint32 *apiVersion,                      // IN/OUT
+                VMCI_DeviceShutdownFn *deviceShutdownCB, // UNUSED
+                void *userData,                          // UNUSED
+                void **deviceRegistration)               // OUT
 {
    if (NULL != deviceRegistration) {
       *deviceRegistration = NULL;
@@ -170,7 +170,7 @@ VMCI_DeviceGet(uint32 *apiVersion,                      // IN/OUT
 /*
  *----------------------------------------------------------------------
  *
- * VMCI_DeviceRelease --
+ * vmci_device_release --
  *
  *      Indicates that the caller is done using the VMCI device.
  *
@@ -183,9 +183,9 @@ VMCI_DeviceGet(uint32 *apiVersion,                      // IN/OUT
  *----------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCI_DeviceRelease)
+VMCI_EXPORT_SYMBOL(vmci_device_release)
 void
-VMCI_DeviceRelease(void *deviceRegistration) // UNUSED
+vmci_device_release(void *deviceRegistration) // UNUSED
 {
 }
 #endif // !_WIN32
@@ -252,9 +252,9 @@ VMCIUtil_Init(void)
     * We subscribe to the VMCI_EVENT_CTX_ID_UPDATE here so we can update the
     * internal context id when needed.
     */
-   if (VMCIEvent_Subscribe(VMCI_EVENT_CTX_ID_UPDATE, VMCI_FLAG_EVENT_NONE,
-                           VMCIUtilCidUpdate, NULL,
-                           &ctxUpdateSubID) < VMCI_SUCCESS) {
+   if (vmci_event_subscribe(VMCI_EVENT_CTX_ID_UPDATE, VMCI_FLAG_EVENT_NONE,
+                            VMCIUtilCidUpdate, NULL,
+                            &ctxUpdateSubID) < VMCI_SUCCESS) {
       VMCI_WARNING((LGPFX"Failed to subscribe to event (type=%d).\n",
                     VMCI_EVENT_CTX_ID_UPDATE));
    }
@@ -280,7 +280,7 @@ VMCIUtil_Init(void)
 void
 VMCIUtil_Exit(void)
 {
-   if (VMCIEvent_Unsubscribe(ctxUpdateSubID) < VMCI_SUCCESS) {
+   if (vmci_event_unsubscribe(ctxUpdateSubID) < VMCI_SUCCESS) {
       VMCI_WARNING((LGPFX"Failed to unsubscribe to event (type=%d) with "
                     "subscriber (ID=0x%x).\n", VMCI_EVENT_CTX_ID_UPDATE,
                     ctxUpdateSubID));
@@ -522,7 +522,7 @@ VMCI_ReadDatagramsFromPort(VMCIIoHandle ioHandle,  // IN
 /*
  *----------------------------------------------------------------------------
  *
- * VMCI_GetContextID --
+ * vmci_get_context_id --
  *
  *    Returns the current context ID.  Note that since this is accessed only
  *    from code running in the host, this always returns the host context ID.
@@ -536,9 +536,9 @@ VMCI_ReadDatagramsFromPort(VMCIIoHandle ioHandle,  // IN
  *----------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCI_GetContextID)
+VMCI_EXPORT_SYMBOL(vmci_get_context_id)
 VMCIId
-VMCI_GetContextID(void)
+vmci_get_context_id(void)
 {
    if (VMCI_GuestPersonalityActive()) {
       if (Atomic_Read(&vmContextID) == VMCI_INVALID_ID) {
@@ -562,7 +562,7 @@ VMCI_GetContextID(void)
 /*
  *----------------------------------------------------------------------
  *
- * VMCI_Version --
+ * vmci_version --
  *
  *     Returns the version of the VMCI driver.
  *
@@ -575,9 +575,9 @@ VMCI_GetContextID(void)
  *----------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCI_Version)
+VMCI_EXPORT_SYMBOL(vmci_version)
 uint32
-VMCI_Version()
+vmci_version(void)
 {
    return VMCI_VERSION;
 }
index 2f4b35b53859aea018ce7faf3617d4f4c12cf6a9..750440a3e5b2846cbb8a2d36e47aa730bd5c365e 100644 (file)
@@ -692,7 +692,7 @@ VMCIEventUnregisterSubscription(VMCIId subID)    // IN
 /*
  *----------------------------------------------------------------------
  *
- * VMCIEvent_Subscribe --
+ * vmci_event_subscribe --
  *
  *      Subscribe to given event. The callback specified can be fired
  *      in different contexts depending on what flag is specified while
@@ -712,13 +712,13 @@ VMCIEventUnregisterSubscription(VMCIId subID)    // IN
  *----------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIEvent_Subscribe)
+VMCI_EXPORT_SYMBOL(vmci_event_subscribe)
 int
-VMCIEvent_Subscribe(VMCI_Event event,        // IN
-                    uint32 flags,            // IN
-                    VMCI_EventCB callback,   // IN
-                    void *callbackData,      // IN
-                    VMCIId *subscriptionID)  // OUT
+vmci_event_subscribe(VMCI_Event event,        // IN
+                     uint32 flags,            // IN
+                     VMCI_EventCB callback,   // IN
+                     void *callbackData,      // IN
+                     VMCIId *subscriptionID)  // OUT
 {
    int retval;
    VMCISubscription *s = NULL;
@@ -748,7 +748,7 @@ VMCIEvent_Subscribe(VMCI_Event event,        // IN
 /*
  *----------------------------------------------------------------------
  *
- * VMCIEvent_Unsubscribe --
+ * vmci_event_unsubscribe --
  *
  *      Unsubscribe to given event. Removes it from list and frees it.
  *      Will return callbackData if requested by caller.
@@ -762,9 +762,9 @@ VMCIEvent_Subscribe(VMCI_Event event,        // IN
  *----------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIEvent_Unsubscribe)
+VMCI_EXPORT_SYMBOL(vmci_event_unsubscribe)
 int
-VMCIEvent_Unsubscribe(VMCIId subID)   // IN
+vmci_event_unsubscribe(VMCIId subID)   // IN
 {
    VMCISubscription *s;
 
index 21d2b54f81a72b7a87f11fff00c80b9958fca523..b04ef95d5ceb7e63d793a0285cfe5c9aca2852ad 100644 (file)
@@ -676,14 +676,14 @@ VPageChannelDoDoorbellCallback(VPageChannel *channel) // IN/OUT
    }
 
 retry:
-   while (VMCIQPair_ConsumeBufReady(channel->qpair) >= sizeof packetHeader) {
+   while (vmci_qpair_consume_buf_ready(channel->qpair) >= sizeof packetHeader) {
       ssize_t retSize, totalSize;
       VPageChannelPacket *packet;
 
-      retSize = VMCIQPair_Peek(channel->qpair, &packetHeader,
-                               sizeof packetHeader,
-                               /* XXX, UTIL_VMKERNEL_BUFFER for VMKernel. */
-                               0);
+      retSize = vmci_qpair_peek(channel->qpair, &packetHeader,
+                                sizeof packetHeader,
+                                /* XXX, UTIL_VMKERNEL_BUFFER for VMKernel. */
+                                0);
       if (retSize < sizeof packetHeader) {
          /*
           * XXX, deal with partial read.
@@ -700,7 +700,7 @@ retry:
       totalSize = sizeof packetHeader + packetHeader.msgLen +
          packetHeader.numElems * sizeof(VPageChannelElem);
 
-      retSize = VMCIQPair_ConsumeBufReady(channel->qpair);
+      retSize = vmci_qpair_consume_buf_ready(channel->qpair);
       if (retSize < totalSize) {
          /*
           * XXX, deal with partial read.
@@ -728,10 +728,10 @@ retry:
          break;
       }
 
-      retSize = VMCIQPair_Dequeue(channel->qpair, packet,
-                                  totalSize,
-                                  /* XXX, UTIL_VMKERNEL_BUFFER for VMKernel. */
-                                  0);
+      retSize = vmci_qpair_dequeue(channel->qpair, packet,
+                                   totalSize,
+                                   /* XXX, UTIL_VMKERNEL_BUFFER for VMKernel. */
+                                   0);
       if (retSize < totalSize) {
          /*
           * XXX, deal with partial read.
@@ -760,7 +760,7 @@ retry:
     * the lock for any data that might have arrived.
     */
 
-   if (VMCIQPair_ConsumeBufReady(channel->qpair) >= sizeof packetHeader) {
+   if (vmci_qpair_consume_buf_ready(channel->qpair) >= sizeof packetHeader) {
       VPageChannelReleaseRecvLock(channel, flags);
       goto retry;
    }
@@ -952,18 +952,18 @@ VPageChannelDestroyQueuePair(VPageChannel *channel) // IN/OUT
    ASSERT(channel);
 
    if (channel->attachSubId != VMCI_INVALID_ID) {
-      VMCIEvent_Unsubscribe(channel->attachSubId);
+      vmci_event_unsubscribe(channel->attachSubId);
       channel->attachSubId = VMCI_INVALID_ID;
    }
 
    if (channel->detachSubId != VMCI_INVALID_ID) {
-      VMCIEvent_Unsubscribe(channel->detachSubId);
+      vmci_event_unsubscribe(channel->detachSubId);
       channel->detachSubId = VMCI_INVALID_ID;
    }
 
    if (!VMCI_HANDLE_INVALID(channel->qpHandle)) {
       ASSERT(channel->qpair);
-      VMCIQPair_Detach(&channel->qpair);
+      vmci_qpair_detach(&channel->qpair);
       channel->qpHandle = VMCI_INVALID_HANDLE;
       channel->qpair = NULL;
    }
@@ -1010,10 +1010,10 @@ VPageChannelCreateQueuePair(VPageChannel *channel) // IN/OUT
       sema_init(&channel->qpRecvMutex, 1);
    }
 
-   err = VMCIEvent_Subscribe(VMCI_EVENT_QP_PEER_ATTACH,
-                             VMCI_FLAG_EVENT_NONE,
-                             VPageChannelPeerAttachCB,
-                             channel, &channel->attachSubId);
+   err = vmci_event_subscribe(VMCI_EVENT_QP_PEER_ATTACH,
+                              VMCI_FLAG_EVENT_NONE,
+                              VPageChannelPeerAttachCB,
+                              channel, &channel->attachSubId);
    if (err < VMCI_SUCCESS) {
       VMCI_WARNING((LGPFX"Failed to subscribe to attach event "
                     "(channel=%p) (err=%d).\n",
@@ -1022,10 +1022,10 @@ VPageChannelCreateQueuePair(VPageChannel *channel) // IN/OUT
       goto error;
    }
 
-   err = VMCIEvent_Subscribe(VMCI_EVENT_QP_PEER_DETACH,
-                             VMCI_FLAG_EVENT_NONE,
-                             VPageChannelPeerDetachCB,
-                             channel, &channel->detachSubId);
+   err = vmci_event_subscribe(VMCI_EVENT_QP_PEER_DETACH,
+                              VMCI_FLAG_EVENT_NONE,
+                              VPageChannelPeerDetachCB,
+                              channel, &channel->detachSubId);
    if (err < VMCI_SUCCESS) {
       VMCI_WARNING((LGPFX"Failed to subscribe to detach event "
                     "(channel=%p) (err=%d).\n",
@@ -1039,9 +1039,10 @@ VPageChannelCreateQueuePair(VPageChannel *channel) // IN/OUT
    } else {
       flags = 0;
    }
-   err = VMCIQPair_Alloc(&channel->qpair, &channel->qpHandle,
-                         channel->produceQSize, channel->consumeQSize,
-                         VMCI_HOST_CONTEXT_ID, flags, VMCI_NO_PRIVILEGE_FLAGS);
+   err = vmci_qpair_alloc(&channel->qpair, &channel->qpHandle,
+                          channel->produceQSize, channel->consumeQSize,
+                          VMCI_HOST_CONTEXT_ID, flags,
+                          VMCI_NO_PRIVILEGE_FLAGS);
    if (err < 0) {
       VMCI_WARNING((LGPFX"Could not create queue pair (err=%d).\n",
                     err));
@@ -1158,9 +1159,9 @@ VPageChannel_CreateInVM(VPageChannel **channel,              // IN/OUT
     */
 
    flags = VMCI_FLAG_DG_DELAYED_CB;
-   retval = VMCIDatagram_CreateHnd(resourceId, flags,
-                                   VPageChannelDgRecvFunc, pageChannel,
-                                   &pageChannel->dgHandle);
+   retval = vmci_datagram_create_handle(resourceId, flags,
+                                        VPageChannelDgRecvFunc, pageChannel,
+                                        &pageChannel->dgHandle);
    if (retval < VMCI_SUCCESS) {
       VMCI_WARNING((LGPFX"Failed to create datagram handle "
                     "(channel=%p) (err=%d).\n",
@@ -1184,9 +1185,9 @@ VPageChannel_CreateInVM(VPageChannel **channel,              // IN/OUT
 
    flags = channelFlags & VPAGECHANNEL_FLAGS_RECV_DELAYED ?
       VMCI_FLAG_DELAYED_CB : 0;
-   retval = VMCIDoorbell_Create(&pageChannel->doorbellHandle,
-                                flags, VMCI_PRIVILEGE_FLAG_RESTRICTED,
-                                VPageChannelDoorbellCallback, pageChannel);
+   retval = vmci_doorbell_create(&pageChannel->doorbellHandle,
+                                 flags, VMCI_PRIVILEGE_FLAG_RESTRICTED,
+                                 VPageChannelDoorbellCallback, pageChannel);
    if (retval < VMCI_SUCCESS) {
       VMCI_WARNING((LGPFX"Failed to create doorbell "
                     "(channel=%p) (err=%d).\n",
@@ -1276,11 +1277,11 @@ VPageChannel_Destroy(VPageChannel *channel) // IN/OUT
    VPageChannelDestroyQueuePair(channel);
 
    if (!VMCI_HANDLE_INVALID(channel->doorbellHandle)) {
-      VMCIDoorbell_Destroy(channel->doorbellHandle);
+      vmci_doorbell_destroy(channel->doorbellHandle);
    }
 
    if (!VMCI_HANDLE_INVALID(channel->dgHandle)) {
-      VMCIDatagram_DestroyHnd(channel->dgHandle);
+      vmci_datagram_destroy_handle(channel->dgHandle);
    }
 
    channel->state = VPCState_Free;
@@ -1421,7 +1422,7 @@ VPageChannelSendControl(VPageChannel *channel,       // IN
              numElems * sizeof (VPageChannelElem));
    }
 
-   retval = VMCIDatagram_Send(dg);
+   retval = vmci_datagram_send(dg);
    if (retval < VMCI_SUCCESS) {
       VMCI_WARNING((LGPFX"Failed to send packet (channel=%p) to "
                     "(handle=0x%x:0x%x) (err=%d).\n",
@@ -1467,9 +1468,9 @@ VPageChannelSignal(VPageChannel *channel) // IN
 
    ASSERT(channel);
 
-   retval = VMCIDoorbell_Notify(channel->peerDoorbellHandle,
-                                /* XXX, TRUSTED for VMKernel. */
-                                VMCI_PRIVILEGE_FLAG_RESTRICTED);
+   retval = vmci_doorbell_notify(channel->peerDoorbellHandle,
+                                 /* XXX, TRUSTED for VMKernel. */
+                                 VMCI_PRIVILEGE_FLAG_RESTRICTED);
    if (retval < VMCI_SUCCESS) {
       VMCI_WARNING((LGPFX"Failed to notify doorbell (channel=%p) "
                "(handle=0x%x:0x%x) (err=%d).\n",
@@ -1541,7 +1542,7 @@ VPageChannelSendPacket(VPageChannel *channel,         // IN
       flags = 0; /* Silence compiler. */
    }
 
-   freeSpace = VMCIQPair_ProduceFreeSpace(channel->qpair);
+   freeSpace = vmci_qpair_produce_free_space(channel->qpair);
    if (freeSpace < totalSize) {
       VMCI_WARNING((LGPFX"No free space in queuepair (channel=%p) "
                     "(required=%"FMTSZ"d) (actual=%"FMTSZ"d).\n",
@@ -1552,10 +1553,10 @@ VPageChannelSendPacket(VPageChannel *channel,         // IN
       goto exit;
    }
 
-   sentSize = VMCIQPair_Enqueue(channel->qpair, packet, totalSize, 0);
+   sentSize = vmci_qpair_enqueue(channel->qpair, packet, totalSize, 0);
 
    if (!signalPending) {
-      if (sentSize == VMCIQPair_ProduceBufReady(channel->qpair)) {
+      if (sentSize == vmci_qpair_produce_buf_ready(channel->qpair)) {
          retval = VPageChannelSignal(channel);
          if (retval < VMCI_SUCCESS) {
             goto exit;
index 5fc8e8557ccdf07e72f2b79177124550d689b38d..5c5253fd09e8b45fc89b85e1421276c95d4691ca 100644 (file)
@@ -418,7 +418,7 @@ VMCIQPairWaitForReadyQueue(VMCIQPair *qpair)
 /*
  *-----------------------------------------------------------------------------
  *
- * VMCIQPair_Alloc --
+ * vmci_qpair_alloc --
  *
  *      This is the client interface for allocating the memory for a
  *      VMCIQPair structure and then attaching to the underlying
@@ -436,15 +436,15 @@ VMCIQPairWaitForReadyQueue(VMCIQPair *qpair)
  *-----------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIQPair_Alloc)
+VMCI_EXPORT_SYMBOL(vmci_qpair_alloc)
 int
-VMCIQPair_Alloc(VMCIQPair **qpair,            // OUT
-                VMCIHandle *handle,           // OUT
-                uint64 produceQSize,          // IN
-                uint64 consumeQSize,          // IN
-                VMCIId peer,                  // IN
-                uint32 flags,                 // IN
-                VMCIPrivilegeFlags privFlags) // IN
+vmci_qpair_alloc(VMCIQPair **qpair,            // OUT
+                 VMCIHandle *handle,           // OUT
+                 uint64 produceQSize,          // IN
+                 uint64 consumeQSize,          // IN
+                 VMCIId peer,                  // IN
+                 uint32 flags,                 // IN
+                 VMCIPrivilegeFlags privFlags) // IN
 {
    VMCIQPair *myQPair;
    int retval;
@@ -566,7 +566,7 @@ VMCIQPair_Alloc(VMCIQPair **qpair,            // OUT
 /*
  *-----------------------------------------------------------------------------
  *
- * VMCIQPair_Detach --
+ * vmci_qpair_detach --
  *
  *      This is the client interface for detaching from a VMCIQPair.
  *      Note that this routine will free the memory allocated for the
@@ -581,9 +581,9 @@ VMCIQPair_Alloc(VMCIQPair **qpair,            // OUT
  *-----------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIQPair_Detach)
+VMCI_EXPORT_SYMBOL(vmci_qpair_detach)
 int
-VMCIQPair_Detach(VMCIQPair **qpair) // IN/OUT
+vmci_qpair_detach(VMCIQPair **qpair) // IN/OUT
 {
    int result;
    VMCIQPair *oldQPair;
@@ -616,7 +616,7 @@ VMCIQPair_Detach(VMCIQPair **qpair) // IN/OUT
 /*
  *-----------------------------------------------------------------------------
  *
- * VMCIQPair_GetProduceIndexes --
+ * vmci_qpair_get_produce_indexes --
  *
  *      This is the client interface for getting the current indexes of the
  *      QPair from the point of the view of the caller as the producer.
@@ -631,11 +631,11 @@ VMCIQPair_Detach(VMCIQPair **qpair) // IN/OUT
  *-----------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIQPair_GetProduceIndexes)
+VMCI_EXPORT_SYMBOL(vmci_qpair_get_produce_indexes)
 int
-VMCIQPair_GetProduceIndexes(const VMCIQPair *qpair, // IN
-                            uint64 *producerTail,   // OUT
-                            uint64 *consumerHead)   // OUT
+vmci_qpair_get_produce_indexes(const VMCIQPair *qpair, // IN
+                               uint64 *producerTail,   // OUT
+                               uint64 *consumerHead)   // OUT
 {
    VMCIQueueHeader *produceQHeader;
    VMCIQueueHeader *consumeQHeader;
@@ -666,7 +666,7 @@ VMCIQPair_GetProduceIndexes(const VMCIQPair *qpair, // IN
 /*
  *-----------------------------------------------------------------------------
  *
- * VMCIQPair_GetConsumeIndexes --
+ * vmci_qpair_get_consume_indexes --
  *
  *      This is the client interface for getting the current indexes of the
  *      QPair from the point of the view of the caller as the consumer.
@@ -681,11 +681,11 @@ VMCIQPair_GetProduceIndexes(const VMCIQPair *qpair, // IN
  *-----------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIQPair_GetConsumeIndexes)
+VMCI_EXPORT_SYMBOL(vmci_qpair_get_consume_indexes)
 int
-VMCIQPair_GetConsumeIndexes(const VMCIQPair *qpair, // IN
-                            uint64 *consumerTail,   // OUT
-                            uint64 *producerHead)   // OUT
+vmci_qpair_get_consume_indexes(const VMCIQPair *qpair, // IN
+                               uint64 *consumerTail,   // OUT
+                               uint64 *producerHead)   // OUT
 {
    VMCIQueueHeader *produceQHeader;
    VMCIQueueHeader *consumeQHeader;
@@ -716,7 +716,7 @@ VMCIQPair_GetConsumeIndexes(const VMCIQPair *qpair, // IN
 /*
  *-----------------------------------------------------------------------------
  *
- * VMCIQPair_ProduceFreeSpace --
+ * vmci_qpair_produce_free_space --
  *
  *      This is the client interface for getting the amount of free
  *      space in the QPair from the point of the view of the caller as
@@ -733,9 +733,9 @@ VMCIQPair_GetConsumeIndexes(const VMCIQPair *qpair, // IN
  *-----------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIQPair_ProduceFreeSpace)
+VMCI_EXPORT_SYMBOL(vmci_qpair_produce_free_space)
 int64
-VMCIQPair_ProduceFreeSpace(const VMCIQPair *qpair) // IN
+vmci_qpair_produce_free_space(const VMCIQPair *qpair) // IN
 {
    VMCIQueueHeader *produceQHeader;
    VMCIQueueHeader *consumeQHeader;
@@ -762,7 +762,7 @@ VMCIQPair_ProduceFreeSpace(const VMCIQPair *qpair) // IN
 /*
  *-----------------------------------------------------------------------------
  *
- * VMCIQPair_ConsumeFreeSpace --
+ * vmci_qpair_consume_free_space --
  *
  *      This is the client interface for getting the amount of free
  *      space in the QPair from the point of the view of the caller as
@@ -780,9 +780,9 @@ VMCIQPair_ProduceFreeSpace(const VMCIQPair *qpair) // IN
  *-----------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIQPair_ConsumeFreeSpace)
+VMCI_EXPORT_SYMBOL(vmci_qpair_consume_free_space)
 int64
-VMCIQPair_ConsumeFreeSpace(const VMCIQPair *qpair) // IN
+vmci_qpair_consume_free_space(const VMCIQPair *qpair) // IN
 {
    VMCIQueueHeader *produceQHeader;
    VMCIQueueHeader *consumeQHeader;
@@ -809,7 +809,7 @@ VMCIQPair_ConsumeFreeSpace(const VMCIQPair *qpair) // IN
 /*
  *-----------------------------------------------------------------------------
  *
- * VMCIQPair_ProduceBufReady --
+ * vmci_qpair_produce_buf_ready --
  *
  *      This is the client interface for getting the amount of
  *      enqueued data in the QPair from the point of the view of the
@@ -827,9 +827,9 @@ VMCIQPair_ConsumeFreeSpace(const VMCIQPair *qpair) // IN
  *-----------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIQPair_ProduceBufReady)
+VMCI_EXPORT_SYMBOL(vmci_qpair_produce_buf_ready)
 int64
-VMCIQPair_ProduceBufReady(const VMCIQPair *qpair) // IN
+vmci_qpair_produce_buf_ready(const VMCIQPair *qpair) // IN
 {
    VMCIQueueHeader *produceQHeader;
    VMCIQueueHeader *consumeQHeader;
@@ -856,7 +856,7 @@ VMCIQPair_ProduceBufReady(const VMCIQPair *qpair) // IN
 /*
  *-----------------------------------------------------------------------------
  *
- * VMCIQPair_ConsumeBufReady --
+ * vmci_qpair_consume_buf_ready --
  *
  *      This is the client interface for getting the amount of
  *      enqueued data in the QPair from the point of the view of the
@@ -873,9 +873,9 @@ VMCIQPair_ProduceBufReady(const VMCIQPair *qpair) // IN
  *-----------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIQPair_ConsumeBufReady)
+VMCI_EXPORT_SYMBOL(vmci_qpair_consume_buf_ready)
 int64
-VMCIQPair_ConsumeBufReady(const VMCIQPair *qpair) // IN
+vmci_qpair_consume_buf_ready(const VMCIQPair *qpair) // IN
 {
    VMCIQueueHeader *produceQHeader;
    VMCIQueueHeader *consumeQHeader;
@@ -1077,7 +1077,7 @@ DequeueLocked(VMCIQueue *produceQ,                        // IN
 /*
  *-----------------------------------------------------------------------------
  *
- * VMCIQPair_Enqueue --
+ * vmci_qpair_enqueue --
  *
  *      This is the client interface for enqueueing data into the queue.
  *
@@ -1091,12 +1091,12 @@ DequeueLocked(VMCIQueue *produceQ,                        // IN
  *-----------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIQPair_Enqueue)
+VMCI_EXPORT_SYMBOL(vmci_qpair_enqueue)
 ssize_t
-VMCIQPair_Enqueue(VMCIQPair *qpair,        // IN
-                  const void *buf,         // IN
-                  size_t bufSize,          // IN
-                  int bufType)             // IN
+vmci_qpair_enqueue(VMCIQPair *qpair,        // IN
+                   const void *buf,         // IN
+                   size_t bufSize,          // IN
+                   int bufType)             // IN
 {
    ssize_t result;
 
@@ -1134,7 +1134,7 @@ VMCIQPair_Enqueue(VMCIQPair *qpair,        // IN
 /*
  *-----------------------------------------------------------------------------
  *
- * VMCIQPair_Dequeue --
+ * vmci_qpair_dequeue --
  *
  *      This is the client interface for dequeueing data from the queue.
  *
@@ -1148,12 +1148,12 @@ VMCIQPair_Enqueue(VMCIQPair *qpair,        // IN
  *-----------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIQPair_Dequeue)
+VMCI_EXPORT_SYMBOL(vmci_qpair_dequeue)
 ssize_t
-VMCIQPair_Dequeue(VMCIQPair *qpair,        // IN
-                  void *buf,               // IN
-                  size_t bufSize,          // IN
-                  int bufType)             // IN
+vmci_qpair_dequeue(VMCIQPair *qpair,        // IN
+                   void *buf,               // IN
+                   size_t bufSize,          // IN
+                   int bufType)             // IN
 {
    ssize_t result;
 
@@ -1191,7 +1191,7 @@ VMCIQPair_Dequeue(VMCIQPair *qpair,        // IN
 /*
  *-----------------------------------------------------------------------------
  *
- * VMCIQPair_Peek --
+ * vmci_qpair_peek --
  *
  *      This is the client interface for peeking into a queue.  (I.e.,
  *      copy data from the queue without updating the head pointer.)
@@ -1206,12 +1206,12 @@ VMCIQPair_Dequeue(VMCIQPair *qpair,        // IN
  *-----------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIQPair_Peek)
+VMCI_EXPORT_SYMBOL(vmci_qpair_peek)
 ssize_t
-VMCIQPair_Peek(VMCIQPair *qpair,    // IN
-               void *buf,           // IN
-               size_t bufSize,      // IN
-               int bufType)         // IN
+vmci_qpair_peek(VMCIQPair *qpair,    // IN
+                void *buf,           // IN
+                size_t bufSize,      // IN
+                int bufType)         // IN
 {
    ssize_t result;
 
@@ -1253,7 +1253,7 @@ VMCIQPair_Peek(VMCIQPair *qpair,    // IN
 /*
  *-----------------------------------------------------------------------------
  *
- * VMCIQPair_EnqueueV --
+ * vmci_qpair_enquev --
  *
  *      This is the client interface for enqueueing data into the queue.
  *
@@ -1267,12 +1267,12 @@ VMCIQPair_Peek(VMCIQPair *qpair,    // IN
  *-----------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIQPair_EnqueueV)
+VMCI_EXPORT_SYMBOL(vmci_qpair_enquev)
 ssize_t
-VMCIQPair_EnqueueV(VMCIQPair *qpair,        // IN
-                   void *iov,               // IN
-                   size_t iovSize,          // IN
-                   int bufType)             // IN
+vmci_qpair_enquev(VMCIQPair *qpair,        // IN
+                  void *iov,               // IN
+                  size_t iovSize,          // IN
+                  int bufType)             // IN
 {
    ssize_t result;
 
@@ -1310,7 +1310,7 @@ VMCIQPair_EnqueueV(VMCIQPair *qpair,        // IN
 /*
  *-----------------------------------------------------------------------------
  *
- * VMCIQPair_DequeueV --
+ * vmci_qpair_dequev --
  *
  *      This is the client interface for dequeueing data from the queue.
  *
@@ -1324,12 +1324,12 @@ VMCIQPair_EnqueueV(VMCIQPair *qpair,        // IN
  *-----------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIQPair_DequeueV)
+VMCI_EXPORT_SYMBOL(vmci_qpair_dequev)
 ssize_t
-VMCIQPair_DequeueV(VMCIQPair *qpair,         // IN
-                   void *iov,                // IN
-                   size_t iovSize,           // IN
-                   int bufType)              // IN
+vmci_qpair_dequev(VMCIQPair *qpair,         // IN
+                  void *iov,                // IN
+                  size_t iovSize,           // IN
+                  int bufType)              // IN
 {
    ssize_t result;
 
@@ -1367,7 +1367,7 @@ VMCIQPair_DequeueV(VMCIQPair *qpair,         // IN
 /*
  *-----------------------------------------------------------------------------
  *
- * VMCIQPair_PeekV --
+ * vmci_qpair_peekv --
  *
  *      This is the client interface for peeking into a queue.  (I.e.,
  *      copy data from the queue without updating the head pointer.)
@@ -1382,12 +1382,12 @@ VMCIQPair_DequeueV(VMCIQPair *qpair,         // IN
  *-----------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIQPair_PeekV)
+VMCI_EXPORT_SYMBOL(vmci_qpair_peekv)
 ssize_t
-VMCIQPair_PeekV(VMCIQPair *qpair,           // IN
-                void *iov,                  // IN
-                size_t iovSize,             // IN
-                int bufType)                // IN
+vmci_qpair_peekv(VMCIQPair *qpair,           // IN
+                 void *iov,                  // IN
+                 size_t iovSize,             // IN
+                 int bufType)                // IN
 {
    ssize_t result;
 
index 6d0fc7e6c02726ed06f3278203e19099a9b97a65..921105ad943f50ddc46b022431b6873986e4f827 100644 (file)
@@ -2252,7 +2252,7 @@ QPGuestEndpointCreate(VMCIHandle handle,  // IN
    ASSERT((produceSize || consumeSize) && produceQ && consumeQ);
 
    if (VMCI_HANDLE_INVALID(handle)) {
-      VMCIId contextID = VMCI_GetContextID();
+      VMCIId contextID = vmci_get_context_id();
       VMCIId oldRID = queuePairRID;
 
       /*
@@ -2528,7 +2528,7 @@ VMCIQueuePairAllocGuestWork(VMCIHandle *handle,           // IN/OUT
     */
    if (queuePairEntry->qp.flags & VMCI_QPFLAG_LOCAL) {
       /* Local create case. */
-      VMCIId contextId = VMCI_GetContextID();
+      VMCIId contextId = vmci_get_context_id();
 
       /*
        * Enforce similar checks on local queue pairs as we do for regular ones.
@@ -2771,9 +2771,7 @@ QueuePairNotifyPeerLocal(Bool attach,           // IN: attach or detach?
    VMCIEventPayload_QP *ePayload;
    /* buf is only 48 bytes. */
    char buf[sizeof *eMsg + sizeof *ePayload];
-   VMCIId contextId;
-
-   contextId = VMCI_GetContextID();
+   VMCIId contextId = vmci_get_context_id();
 
    eMsg = (VMCIEventMsg *)buf;
    ePayload = VMCIEventMsgPayload(eMsg);
index 81c9d077ceef60f2bfab427ca4794196d09e7e54..6dd1eb9d97f469b6adb1f1c99cb47e31df0573f6 100644 (file)
@@ -122,7 +122,7 @@ VMCI_Route(VMCIHandle *src,       // IN/OUT
        */
 
       if (VMCI_INVALID_ID == src->context && VMCI_INVALID_ID != src->resource) {
-         src->context = VMCI_GetContextID();
+         src->context = vmci_get_context_id();
       }
 
       /* Send from local client down to the hypervisor. */
@@ -159,7 +159,7 @@ VMCI_Route(VMCIHandle *src,       // IN/OUT
       if (!fromGuest && hasGuestDevice) {
          /* If no source context then use the current. */
          if (VMCI_INVALID_ID == src->context) {
-            src->context = VMCI_GetContextID();
+            src->context = vmci_get_context_id();
          }
 
          /* Send it from local client down to the host. */
@@ -258,7 +258,7 @@ VMCI_Route(VMCIHandle *src,       // IN/OUT
 
    /* If no source context then use the current context. */
    if (VMCI_INVALID_ID == src->context) {
-      src->context = VMCI_GetContextID();
+      src->context = vmci_get_context_id();
    }
 
    /*
index b220c6aac0d1f4a7dc6750ae7fef4542b02872b1..410638528f80f2728c089ddbb79788e8da687981 100644 (file)
@@ -25,8 +25,8 @@
 #ifndef _VMCI_VERSION_H_
 #define _VMCI_VERSION_H_
 
-#define VMCI_DRIVER_VERSION          9.5.12.0
-#define VMCI_DRIVER_VERSION_COMMAS   9,5,12,0
-#define VMCI_DRIVER_VERSION_STRING   "9.5.12.0"
+#define VMCI_DRIVER_VERSION          9.5.13.0
+#define VMCI_DRIVER_VERSION_COMMAS   9,5,13,0
+#define VMCI_DRIVER_VERSION_STRING   "9.5.13.0"
 
 #endif /* _VMCI_VERSION_H_ */
index 04dd89bd5384aaf35c0e6fca1379546ee0b9d796..4da858fa3f50238411f727cbb6ab20c44e295d8a 100644 (file)
@@ -223,7 +223,7 @@ HgfsRequestAsyncShmemDispatch(HgfsAsyncIov *iov, // IN: request vectors
  *      Passes down free pages to the hgfs Server. HgfsServer will use this pages
  *      for sending change notification, oplock breaks etc.
  *
- *      XXX It seems safe to call VMCIDatagram_Send in atomic context.
+ *      XXX It seems safe to call vmci_datagram_send in atomic context.
  *
  * Results:
  *      None
@@ -281,7 +281,7 @@ HgfsVmciChannelPassGuestPages(HgfsTransportChannel *channel) // IN:
    transportHeader->pktType = HGFS_TH_REP_GET_PAGES;
 
    LOG(10, (KERN_WARNING "Sending %d Guest pages \n", i));
-   if ((ret = VMCIDatagram_Send(dg)) < VMCI_SUCCESS) {
+   if ((ret = vmci_datagram_send(dg)) < VMCI_SUCCESS) {
       if (ret == HGFS_VMCI_TRANSPORT_ERROR) {
          LOG(0, (KERN_WARNING "HGFS Transport error occured. Don't blame VMCI\n"));
       }
@@ -447,11 +447,12 @@ HgfsVmciChannelOpen(HgfsTransportChannel *channel) // IN: Channel
       goto error;
    }
 
-   ret = VMCIDatagram_CreateHnd(VMCI_INVALID_ID,        /* Resource ID */
-                                VMCI_FLAG_DG_NONE,      /* Flags */
-                                HgfsVmciChannelCallback,/* Datagram Recv Callback */
-                                NULL,                   /* Callback data */
-                                channel->priv);         /* VMCI outhandle */
+   ret = vmci_datagram_create_handle(
+                          VMCI_INVALID_ID,        /* Resource ID */
+                          VMCI_FLAG_DG_NONE,      /* Flags */
+                          HgfsVmciChannelCallback,/* Datagram Recv Callback */
+                          NULL,                   /* Callback data */
+                          channel->priv);         /* VMCI outhandle */
    if (ret != VMCI_SUCCESS) {
       LOG(1, (KERN_WARNING "Failed to create VMCI handle %d\n", ret));
       goto error;
@@ -542,7 +543,7 @@ HgfsVmciChannelTerminateSession(HgfsTransportChannel *channel) {
    transportHeader->pktType = HGFS_TH_TERMINATE_SESSION;
 
    LOG(1, (KERN_WARNING "Terminating session with host \n"));
-   if ((ret = VMCIDatagram_Send(dg)) < VMCI_SUCCESS) {
+   if ((ret = vmci_datagram_send(dg)) < VMCI_SUCCESS) {
       if (ret == HGFS_VMCI_TRANSPORT_ERROR) {
          LOG(0, (KERN_WARNING "HGFS Transport error occured. Don't blame VMCI\n"));
       }
@@ -580,7 +581,7 @@ HgfsVmciChannelClose(HgfsTransportChannel *channel) // IN: Channel
 {
    ASSERT(channel->priv != NULL);
    HgfsVmciChannelTerminateSession(channel);
-   VMCIDatagram_DestroyHnd(*(VMCIHandle *)channel->priv);
+   vmci_datagram_destroy_handle(*(VMCIHandle *)channel->priv);
    kfree(channel->priv);
    kfree(gHgfsShmemPages.list);
    channel->priv = NULL;
@@ -754,14 +755,14 @@ HgfsVmciChannelSend(HgfsTransportChannel *channel, // IN: Channel
    transportStatus->size = req->bufferSize + sizeof (HgfsVmciTransportStatus);
 
    /*
-    * Don't try to set req->state after VMCIDatagram_Send().
+    * Don't try to set req->state after vmci_datagram_send().
     * It may be too late then. We could have received a datagram by then and
     * datagram handler expects request's state to be submitted.
     */
    req->state = HGFS_REQ_STATE_SUBMITTED;
    id = req->id;
 
-   if ((ret = VMCIDatagram_Send(dg)) < VMCI_SUCCESS) {
+   if ((ret = vmci_datagram_send(dg)) < VMCI_SUCCESS) {
       if (ret == HGFS_VMCI_TRANSPORT_ERROR) {
          LOG(0, (KERN_WARNING "HGFS Transport error occured. Don't blame VMCI\n"));
       } else if (ret == HGFS_VMCI_VERSION_MISMATCH) {
index 7477e7051caf1747b71c0e5c60a063ebf9439727..566763bb322787a1685213dfcdea6a37ccc115da 100644 (file)
@@ -547,7 +547,7 @@ VSockVmciTrusted(VSockVmciSock *vsock, // IN: Local socket
       return TRUE;
    }
 
-   res = VMCI_IsContextOwner(peerCid, &vsock->owner);
+   res = vmci_is_context_owner(peerCid, &vsock->owner);
 
    return res == VMCI_SUCCESS;
 }
@@ -578,7 +578,8 @@ VSockVmciAllowDgram(VSockVmciSock *vsock, // IN: Local socket
    if (vsock->cachedPeer != peerCid) {
       vsock->cachedPeer = peerCid;
       if (!VSockVmciTrusted(vsock, peerCid) &&
-          (VMCIContext_GetPrivFlags(peerCid) & VMCI_PRIVILEGE_FLAG_RESTRICTED)) {
+          (vmci_context_get_priv_flags(peerCid) &
+           VMCI_PRIVILEGE_FLAG_RESTRICTED)) {
          vsock->cachedPeerAllowDgram = FALSE;
       } else {
          vsock->cachedPeerAllowDgram = TRUE;
@@ -668,7 +669,7 @@ VMCISock_GetLocalCID(void)
       goto exit;
    }
 
-   cid = VMCI_GetContextID();
+   cid = vmci_get_context_id();
 
 exit:
    compat_mutex_unlock(&registrationMutex);
@@ -833,15 +834,15 @@ VSockVmciQueuePairAlloc(VMCIQPair **qpair,    // OUT
        * if vsock is running in the host.
        */
 
-      err = VMCIQPair_Alloc(qpair, handle, produceSize, consumeSize,
-                            peer, flags, VMCI_PRIVILEGE_FLAG_TRUSTED);
+      err = vmci_qpair_alloc(qpair, handle, produceSize, consumeSize,
+                             peer, flags, VMCI_PRIVILEGE_FLAG_TRUSTED);
       if (err != VMCI_ERROR_NO_ACCESS) {
          goto out;
       }
    }
 
-   err = VMCIQPair_Alloc(qpair, handle, produceSize, consumeSize,
-                         peer, flags, VMCI_NO_PRIVILEGE_FLAGS);
+   err = vmci_qpair_alloc(qpair, handle, produceSize, consumeSize,
+                          peer, flags, VMCI_NO_PRIVILEGE_FLAGS);
 out:
    if (err < 0) {
       Log("Could not attach to queue pair with %d\n", err);
@@ -884,15 +885,13 @@ VSockVmciDatagramCreateHnd(VMCIId resourceID,            // IN
     * if vsock is running in the host.
     */
 
-   err = VMCIDatagram_CreateHndPriv(resourceID, flags,
-                                    VMCI_PRIVILEGE_FLAG_TRUSTED,
-                                    recvCB, clientData,
-                                    outHandle);
+   err = vmci_datagram_create_handle_priv(resourceID, flags,
+                                          VMCI_PRIVILEGE_FLAG_TRUSTED,
+                                          recvCB, clientData, outHandle);
 
    if (err == VMCI_ERROR_NO_ACCESS) {
-      err = VMCIDatagram_CreateHnd(resourceID, flags,
-                                   recvCB, clientData,
-                                   outHandle);
+      err = vmci_datagram_create_handle(resourceID, flags, recvCB, clientData,
+                                        outHandle);
    }
 
    return err;
@@ -1839,11 +1838,11 @@ VSockVmciRecvConnectingServer(struct sock *listener, // IN: the listening socket
     * We don't care about attach since we ensure the other side has attached by
     * specifying the ATTACH_ONLY flag below.
     */
-   err = VMCIEvent_Subscribe(VMCI_EVENT_QP_PEER_DETACH,
-                             VMCI_FLAG_EVENT_NONE,
-                             VSockVmciPeerDetachCB,
-                             pending,
-                             &detachSubId);
+   err = vmci_event_subscribe(VMCI_EVENT_QP_PEER_DETACH,
+                              VMCI_FLAG_EVENT_NONE,
+                              VSockVmciPeerDetachCB,
+                              pending,
+                              &detachSubId);
    if (err < VMCI_SUCCESS) {
       VSOCK_SEND_RESET(pending, pkt);
       err = VSockVmci_ErrorToVSockError(err);
@@ -2187,21 +2186,21 @@ VSockVmciRecvConnectingClientNegotiate(struct sock *sk,   // IN: socket
     * to find the socket (it's provided), but later we should only subscribe
     * once and add a way to lookup sockets by queue pair handle.
     */
-   err = VMCIEvent_Subscribe(VMCI_EVENT_QP_PEER_ATTACH,
-                             VMCI_FLAG_EVENT_NONE,
-                             VSockVmciPeerAttachCB,
-                             sk,
-                             &attachSubId);
+   err = vmci_event_subscribe(VMCI_EVENT_QP_PEER_ATTACH,
+                              VMCI_FLAG_EVENT_NONE,
+                              VSockVmciPeerAttachCB,
+                              sk,
+                              &attachSubId);
    if (err < VMCI_SUCCESS) {
       err = VSockVmci_ErrorToVSockError(err);
       goto destroy;
    }
 
-   err = VMCIEvent_Subscribe(VMCI_EVENT_QP_PEER_DETACH,
-                             VMCI_FLAG_EVENT_NONE,
-                             VSockVmciPeerDetachCB,
-                             sk,
-                             &detachSubId);
+   err = vmci_event_subscribe(VMCI_EVENT_QP_PEER_DETACH,
+                              VMCI_FLAG_EVENT_NONE,
+                              VSockVmciPeerDetachCB,
+                              sk,
+                              &detachSubId);
    if (err < VMCI_SUCCESS) {
       err = VSockVmci_ErrorToVSockError(err);
       goto destroy;
@@ -2243,18 +2242,18 @@ VSockVmciRecvConnectingClientNegotiate(struct sock *sk,   // IN: socket
 
 destroy:
    if (attachSubId != VMCI_INVALID_ID) {
-      VMCIEvent_Unsubscribe(attachSubId);
+      vmci_event_unsubscribe(attachSubId);
       ASSERT(vsk->attachSubId == VMCI_INVALID_ID);
    }
 
    if (detachSubId != VMCI_INVALID_ID) {
-      VMCIEvent_Unsubscribe(detachSubId);
+      vmci_event_unsubscribe(detachSubId);
       ASSERT(vsk->detachSubId == VMCI_INVALID_ID);
    }
 
    if (!VMCI_HANDLE_INVALID(handle)) {
       ASSERT(vsk->qpair);
-      VMCIQPair_Detach(&qpair);
+      vmci_qpair_detach(&qpair);
       ASSERT(VMCI_HANDLE_INVALID(vsk->qpHandle));
    }
 
@@ -2444,7 +2443,7 @@ __VSockVmciSendControlPkt(VSockPacket *pkt,           // IN
    VSockPacket_Init(pkt, src, dst, type, size, mode, wait, proto, handle);
    LOG_PACKET(pkt);
    VSOCK_STATS_CTLPKT_LOG(pkt->type);
-   err = VMCIDatagram_Send(&pkt->dg);
+   err = vmci_datagram_send(&pkt->dg);
    if (convertError && (err < 0)) {
       return VSockVmci_ErrorToVSockError(err);
    }
@@ -2645,7 +2644,7 @@ __VSockVmciBind(struct sock *sk,          // IN/OUT
     */
    VSockAddr_Init(&newAddr, VMADDR_CID_ANY, VMADDR_PORT_ANY);
 
-   cid = VMCI_GetContextID();
+   cid = vmci_get_context_id();
    if (addr->svm_cid != cid &&
        addr->svm_cid != VMADDR_CID_ANY) {
       return -EADDRNOTAVAIL;
@@ -2934,7 +2933,7 @@ __VSockVmciRelease(struct sock *sk) // IN
       }
 
       if (!VMCI_HANDLE_INVALID(vsk->dgHandle)) {
-         VMCIDatagram_DestroyHnd(vsk->dgHandle);
+         vmci_datagram_destroy_handle(vsk->dgHandle);
          vsk->dgHandle = VMCI_INVALID_HANDLE;
       }
 
@@ -2987,18 +2986,18 @@ VSockVmciSkDestruct(struct sock *sk) // IN
    vsk = vsock_sk(sk);
 
    if (vsk->attachSubId != VMCI_INVALID_ID) {
-      VMCIEvent_Unsubscribe(vsk->attachSubId);
+      vmci_event_unsubscribe(vsk->attachSubId);
       vsk->attachSubId = VMCI_INVALID_ID;
    }
 
    if (vsk->detachSubId != VMCI_INVALID_ID) {
-      VMCIEvent_Unsubscribe(vsk->detachSubId);
+      vmci_event_unsubscribe(vsk->detachSubId);
       vsk->detachSubId = VMCI_INVALID_ID;
    }
 
    if (!VMCI_HANDLE_INVALID(vsk->qpHandle)) {
       ASSERT(vsk->qpair);
-      VMCIQPair_Detach(&vsk->qpair);
+      vmci_qpair_detach(&vsk->qpair);
       vsk->qpHandle = VMCI_INVALID_HANDLE;
       ASSERT(vsk->qpair == NULL);
       vsk->produceSize = vsk->consumeSize = 0;
@@ -3255,7 +3254,7 @@ VSockVmciRegisterWithVmci(void)
     * present.
     */
    apiVersion = VMCI_KERNEL_API_VERSION_1;
-   vmciDevicePresent = VMCI_DeviceGet(&apiVersion, NULL, NULL, NULL);
+   vmciDevicePresent = vmci_device_get(&apiVersion, NULL, NULL, NULL);
    if (!vmciDevicePresent) {
       Warning("VMCI device not present.\n");
       return -1;
@@ -3275,11 +3274,11 @@ VSockVmciRegisterWithVmci(void)
       goto out;
    }
 
-   err = VMCIEvent_Subscribe(VMCI_EVENT_QP_RESUMED,
-                             VMCI_FLAG_EVENT_NONE,
-                             VSockVmciQPResumedCB,
-                             NULL,
-                             &qpResumedSubId);
+   err = vmci_event_subscribe(VMCI_EVENT_QP_RESUMED,
+                              VMCI_FLAG_EVENT_NONE,
+                              VSockVmciQPResumedCB,
+                              NULL,
+                              &qpResumedSubId);
    if (err < VMCI_SUCCESS) {
       Warning("Unable to subscribe to QP resumed event. (%d)\n", err);
       err = VSockVmci_ErrorToVSockError(err);
@@ -3322,23 +3321,23 @@ VSockVmciUnregisterWithVmci(void)
    }
 
    if (!VMCI_HANDLE_INVALID(vmciStreamHandle)) {
-      if (VMCIDatagram_DestroyHnd(vmciStreamHandle) != VMCI_SUCCESS) {
+      if (vmci_datagram_destroy_handle(vmciStreamHandle) != VMCI_SUCCESS) {
          Warning("Could not destroy VMCI datagram handle.\n");
       }
       vmciStreamHandle = VMCI_INVALID_HANDLE;
    }
 
    if (qpResumedSubId != VMCI_INVALID_ID) {
-      VMCIEvent_Unsubscribe(qpResumedSubId);
+      vmci_event_unsubscribe(qpResumedSubId);
       qpResumedSubId = VMCI_INVALID_ID;
    }
 
    if (ctxUpdatedSubId != VMCI_INVALID_ID) {
-      VMCIEvent_Unsubscribe(ctxUpdatedSubId);
+      vmci_event_unsubscribe(ctxUpdatedSubId);
       ctxUpdatedSubId = VMCI_INVALID_ID;
    }
 
-   VMCI_DeviceRelease(NULL);
+   vmci_device_release(NULL);
    vmciDevicePresent = FALSE;
 }
 
@@ -3367,7 +3366,7 @@ VSockVmciStreamHasData(VSockVmciSock *vsk) // IN
 {
    ASSERT(vsk);
 
-   return VMCIQPair_ConsumeBufReady(vsk->qpair);
+   return vmci_qpair_consume_buf_ready(vsk->qpair);
 }
 
 
@@ -3395,7 +3394,7 @@ VSockVmciStreamHasSpace(VSockVmciSock *vsk) // IN
 {
    ASSERT(vsk);
 
-   return VMCIQPair_ProduceFreeSpace(vsk->qpair);
+   return vmci_qpair_produce_free_space(vsk->qpair);
 }
 
 
@@ -4250,7 +4249,7 @@ VSockVmciDgramSendmsg(struct kiocb *kiocb,          // UNUSED
       /* Ensure this address is of the right type and is a valid destination. */
       // XXXAB Temporary to handle test program
       if (remoteAddr->svm_cid == VMADDR_CID_ANY) {
-         remoteAddr->svm_cid = VMCI_GetContextID();
+         remoteAddr->svm_cid = vmci_get_context_id();
       }
 
       if (!VSockAddr_Bound(remoteAddr)) {
@@ -4261,7 +4260,7 @@ VSockVmciDgramSendmsg(struct kiocb *kiocb,          // UNUSED
       remoteAddr = &vsk->remoteAddr;
       // XXXAB Temporary to handle test program
       if (remoteAddr->svm_cid == VMADDR_CID_ANY) {
-         remoteAddr->svm_cid = VMCI_GetContextID();
+         remoteAddr->svm_cid = vmci_get_context_id();
       }
 
       /* XXX Should connect() or this function ensure remoteAddr is bound? */
@@ -4305,7 +4304,7 @@ VSockVmciDgramSendmsg(struct kiocb *kiocb,          // UNUSED
 
    dg->payloadSize = len;
 
-   err = VMCIDatagram_Send(dg);
+   err = vmci_datagram_send(dg);
    kfree(dg);
    if (err < 0) {
       err = VSockVmci_ErrorToVSockError(err);
@@ -4658,8 +4657,8 @@ VSockVmciStreamSendmsg(struct kiocb *kiocb,          // UNUSED
        * able to send.
        */
 
-      written = VMCIQPair_EnqueueV(vsk->qpair, msg->msg_iov,
-                                   len - totalWritten, 0);
+      written = vmci_qpair_enquev(vsk->qpair, msg->msg_iov,
+                                  len - totalWritten, 0);
       if (written < 0) {
          err = -ENOMEM;
          goto outWait;
@@ -4901,9 +4900,9 @@ VSockVmciStreamRecvmsg(struct kiocb *kiocb,          // UNUSED
          }
 
          if (flags & MSG_PEEK) {
-            read = VMCIQPair_PeekV(vsk->qpair, msg->msg_iov, len - copied, 0);
+            read = vmci_qpair_peekv(vsk->qpair, msg->msg_iov, len - copied, 0);
          } else {
-            read = VMCIQPair_DequeueV(vsk->qpair, msg->msg_iov, len - copied, 0);
+            read = vmci_qpair_dequev(vsk->qpair, msg->msg_iov, len - copied, 0);
          }
 
          if (read < 0) {
@@ -5274,7 +5273,7 @@ VSockVmciDevIoctl(struct inode *inode,     // IN
    }
 
    case IOCTL_VMCI_SOCKETS_GET_LOCAL_CID: {
-      VMCIId cid = VMCI_GetContextID();
+      VMCIId cid = vmci_get_context_id();
       if (copy_to_user((void *)ioarg, &cid, sizeof cid) != 0) {
          retval = -EFAULT;
       }
index 755b03727774dd9b3452cdc612779e8853c32866..f6279560a34335031e601a5da417d9a84032ba97 100644 (file)
@@ -110,7 +110,7 @@ VSockVmciNotifyWaitingWrite(VSockVmciSock *vsk)    // IN
     *   if writeNotifyWindow > bufferReady then notify
     * as freeSpace == ConsumeSize - bufferReady.
     */
-   retval = VMCIQPair_ConsumeFreeSpace(vsk->qpair) > notifyLimit;
+   retval = vmci_qpair_consume_free_space(vsk->qpair) > notifyLimit;
 #ifdef VSOCK_OPTIMIZATION_FLOW_CONTROL
    if (retval) {
       /*
@@ -158,7 +158,7 @@ VSockVmciNotifyWaitingRead(VSockVmciSock *vsk)  // IN
     * not require a protocol change and will retain compatibility between
     * endpoints with mixed versions of this function.
     */
-   return VMCIQPair_ProduceBufReady(vsk->qpair) > 0;
+   return vmci_qpair_produce_buf_ready(vsk->qpair) > 0;
 #else
    return TRUE;
 #endif
@@ -342,7 +342,7 @@ VSockVmciSendWaitingRead(struct sock *sk,    // IN
              vsk->consumeSize);
    }
 
-   VMCIQPair_GetConsumeIndexes(vsk->qpair, &tail, &head);
+   vmci_qpair_get_consume_indexes(vsk->qpair, &tail, &head);
    roomLeft = vsk->consumeSize - head;
    if (roomNeeded >= roomLeft) {
       waitingInfo.offset = roomNeeded - roomLeft;
@@ -401,7 +401,7 @@ VSockVmciSendWaitingWrite(struct sock *sk,   // IN
       return TRUE;
    }
 
-   VMCIQPair_GetProduceIndexes(vsk->qpair, &tail, &head);
+   vmci_qpair_get_produce_indexes(vsk->qpair, &tail, &head);
    roomLeft = vsk->produceSize - tail;
    if (roomNeeded + 1 >= roomLeft) {
       /* Wraps around to current generation. */
@@ -832,9 +832,9 @@ VSockVmciNotifyPktRecvPreDequeue(struct sock *sk,               // IN
     * socket locked we should copy at least ready bytes.
     */
 #if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
-   VMCIQPair_GetConsumeIndexes(vsk->qpair,
-                               &data->produceTail,
-                               &data->consumeHead);
+   vmci_qpair_get_consume_indexes(vsk->qpair,
+                                  &data->produceTail,
+                                  &data->consumeHead);
 #endif
 
    return 0;
@@ -991,9 +991,9 @@ VSockVmciNotifyPktSendPreEnqueue(struct sock *sk,               // IN
    vsk = vsock_sk(sk);
 
 #if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY)
-      VMCIQPair_GetProduceIndexes(vsk->qpair,
-                                  &data->produceTail,
-                                  &data->consumeHead);
+      vmci_qpair_get_produce_indexes(vsk->qpair,
+                                     &data->produceTail,
+                                     &data->consumeHead);
 #endif
 
    return 0;;
index 0d53c81d22ff4a029dba57aad704070d2a3f76f8..f3816d4b86e722440a43a683b6660c44b431e550 100644 (file)
@@ -99,7 +99,7 @@ VSockVmciNotifyWaitingWrite(VSockVmciSock *vsk)    // IN
     * as freeSpace == ConsumeSize - bufferReady.
     */
 
-   retval = VMCIQPair_ConsumeFreeSpace(vsk->qpair) > notifyLimit;
+   retval = vmci_qpair_consume_free_space(vsk->qpair) > notifyLimit;
 
    if (retval) {
       /*
@@ -553,7 +553,7 @@ VSockVmciNotifyPktRecvPostDequeue(struct sock *sk,               // IN
    if (dataRead) {
       Atomic_MFence();
 
-      freeSpace = VMCIQPair_ConsumeFreeSpace(vsk->qpair);
+      freeSpace = vmci_qpair_consume_free_space(vsk->qpair);
       wasFull = freeSpace == copied;
 
       if (wasFull) {
@@ -637,7 +637,7 @@ VSockVmciNotifyPktSendPostEnqueue(struct sock *sk,               // IN
 
    Atomic_MFence();
 
-   wasEmpty = (VMCIQPair_ProduceBufReady(vsk->qpair) == written);
+   wasEmpty = (vmci_qpair_produce_buf_ready(vsk->qpair) == written);
    if (wasEmpty) {
       while (!(vsk->peerShutdown & RCV_SHUTDOWN) &&
              !sentWrote &&
index e1ed4950fcd0f3d335c7bcb84d86d66ff5407864..6b61f03dcd03df6089a1ba9871c83481357836a5 100644 (file)
@@ -25,8 +25,8 @@
 #ifndef _VSOCK_VERSION_H_
 #define _VSOCK_VERSION_H_
 
-#define VSOCK_DRIVER_VERSION          9.5.6.0
-#define VSOCK_DRIVER_VERSION_COMMAS   9,5,6,0
-#define VSOCK_DRIVER_VERSION_STRING   "9.5.6.0"
+#define VSOCK_DRIVER_VERSION          9.5.7.0
+#define VSOCK_DRIVER_VERSION_COMMAS   9,5,7,0
+#define VSOCK_DRIVER_VERSION_STRING   "9.5.7.0"
 
 #endif /* _VSOCK_VERSION_H_ */