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__)) || \
* 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 */
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. */
#endif /* !__VMCI_KERNELAPI_2_H__ */
-
/*
*----------------------------------------------------------------------
*
- * VMCIContext_GetPrivFlags --
+ * vmci_context_get_priv_flags --
*
* Retrieves the privilege flags of the given VMCI context ID.
*
*----------------------------------------------------------------------
*/
-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;
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)) {
/*
*----------------------------------------------------------------------
*
- * VMCI_ContextID2HostVmID --
+ * vmci_cid_2_host_vm_id --
*
* Maps a context ID to the host specific (process/world) ID
* of the VM/VMX.
*----------------------------------------------------------------------
*/
-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;
/*
*----------------------------------------------------------------------
*
- * VMCI_IsContextOwner --
+ * vmci_is_context_owner --
*
* Determines whether a given host OS specific representation of
* user is the owner of the VM/VMX.
*----------------------------------------------------------------------
*/
-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;
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;
}
/*
*------------------------------------------------------------------------------
*
- * VMCIDatagram_CreateHnd --
+ * vmci_datagram_create_handle --
*
* Creates a host context datagram endpoint and returns a handle to it.
*
*------------------------------------------------------------------------------
*/
-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;
/*
*------------------------------------------------------------------------------
*
- * VMCIDatagram_CreateHndPriv --
+ * vmci_datagram_create_handle_priv --
*
* Creates a host context datagram endpoint and returns a handle to it.
*
*------------------------------------------------------------------------------
*/
-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;
/*
*------------------------------------------------------------------------------
*
- * VMCIDatagram_DestroyHnd --
+ * vmci_datagram_destroy_handle --
*
* Destroys a handle.
*
*------------------------------------------------------------------------------
*/
-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,
} 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;
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)) {
/*
/*
*------------------------------------------------------------------------------
*
- * VMCIDatagram_Send --
+ * vmci_datagram_send --
*
* Sends the payload to the destination datagram handle.
*
*------------------------------------------------------------------------------
*/
-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;
/* 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;
/*
*------------------------------------------------------------------------------
*
- * 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
*------------------------------------------------------------------------------
*/
-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;
}
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;
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;
}
/*
*------------------------------------------------------------------------------
*
- * 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:
*------------------------------------------------------------------------------
*/
-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;
/*
*------------------------------------------------------------------------------
*
- * VMCIDoorbell_Notify --
+ * vmci_doorbell_notify --
*
* Generates a notification on the doorbell identified by the
* handle. For host side generation of notifications, the caller
*------------------------------------------------------------------------------
*/
-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;
/*
*----------------------------------------------------------------------
*
- * 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
*----------------------------------------------------------------------
*/
-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;
/*
*----------------------------------------------------------------------
*
- * VMCI_DeviceRelease --
+ * vmci_device_release --
*
* Indicates that the caller is done using the VMCI device.
*
*----------------------------------------------------------------------
*/
-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
* 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));
}
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));
/*
*----------------------------------------------------------------------------
*
- * 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.
*----------------------------------------------------------------------------
*/
-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) {
/*
*----------------------------------------------------------------------
*
- * VMCI_Version --
+ * vmci_version --
*
* Returns the version of the VMCI driver.
*
*----------------------------------------------------------------------
*/
-VMCI_EXPORT_SYMBOL(VMCI_Version)
+VMCI_EXPORT_SYMBOL(vmci_version)
uint32
-VMCI_Version()
+vmci_version(void)
{
return VMCI_VERSION;
}
/*
*----------------------------------------------------------------------
*
- * 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
*----------------------------------------------------------------------
*/
-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;
/*
*----------------------------------------------------------------------
*
- * VMCIEvent_Unsubscribe --
+ * vmci_event_unsubscribe --
*
* Unsubscribe to given event. Removes it from list and frees it.
* Will return callbackData if requested by caller.
*----------------------------------------------------------------------
*/
-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;
}
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.
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.
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.
* 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;
}
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;
}
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",
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",
} 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));
*/
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",
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",
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;
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",
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",
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",
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;
/*
*-----------------------------------------------------------------------------
*
- * VMCIQPair_Alloc --
+ * vmci_qpair_alloc --
*
* This is the client interface for allocating the memory for a
* VMCIQPair structure and then attaching to the underlying
*-----------------------------------------------------------------------------
*/
-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;
/*
*-----------------------------------------------------------------------------
*
- * 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
*-----------------------------------------------------------------------------
*/
-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;
/*
*-----------------------------------------------------------------------------
*
- * 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.
*-----------------------------------------------------------------------------
*/
-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;
/*
*-----------------------------------------------------------------------------
*
- * 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.
*-----------------------------------------------------------------------------
*/
-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;
/*
*-----------------------------------------------------------------------------
*
- * 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
*-----------------------------------------------------------------------------
*/
-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;
/*
*-----------------------------------------------------------------------------
*
- * 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
*-----------------------------------------------------------------------------
*/
-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;
/*
*-----------------------------------------------------------------------------
*
- * 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
*-----------------------------------------------------------------------------
*/
-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;
/*
*-----------------------------------------------------------------------------
*
- * 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
*-----------------------------------------------------------------------------
*/
-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;
/*
*-----------------------------------------------------------------------------
*
- * VMCIQPair_Enqueue --
+ * vmci_qpair_enqueue --
*
* This is the client interface for enqueueing data into the queue.
*
*-----------------------------------------------------------------------------
*/
-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;
/*
*-----------------------------------------------------------------------------
*
- * VMCIQPair_Dequeue --
+ * vmci_qpair_dequeue --
*
* This is the client interface for dequeueing data from the queue.
*
*-----------------------------------------------------------------------------
*/
-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;
/*
*-----------------------------------------------------------------------------
*
- * 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.)
*-----------------------------------------------------------------------------
*/
-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;
/*
*-----------------------------------------------------------------------------
*
- * VMCIQPair_EnqueueV --
+ * vmci_qpair_enquev --
*
* This is the client interface for enqueueing data into the queue.
*
*-----------------------------------------------------------------------------
*/
-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;
/*
*-----------------------------------------------------------------------------
*
- * VMCIQPair_DequeueV --
+ * vmci_qpair_dequev --
*
* This is the client interface for dequeueing data from the queue.
*
*-----------------------------------------------------------------------------
*/
-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;
/*
*-----------------------------------------------------------------------------
*
- * 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.)
*-----------------------------------------------------------------------------
*/
-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;
ASSERT((produceSize || consumeSize) && produceQ && consumeQ);
if (VMCI_HANDLE_INVALID(handle)) {
- VMCIId contextID = VMCI_GetContextID();
+ VMCIId contextID = vmci_get_context_id();
VMCIId oldRID = queuePairRID;
/*
*/
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.
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);
*/
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. */
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. */
/* 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();
}
/*
#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_ */
* 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
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"));
}
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;
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"));
}
{
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;
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) {
return TRUE;
}
- res = VMCI_IsContextOwner(peerCid, &vsock->owner);
+ res = vmci_is_context_owner(peerCid, &vsock->owner);
return res == VMCI_SUCCESS;
}
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;
goto exit;
}
- cid = VMCI_GetContextID();
+ cid = vmci_get_context_id();
exit:
compat_mutex_unlock(®istrationMutex);
* 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);
* 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;
* 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);
* 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;
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));
}
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);
}
*/
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;
}
if (!VMCI_HANDLE_INVALID(vsk->dgHandle)) {
- VMCIDatagram_DestroyHnd(vsk->dgHandle);
+ vmci_datagram_destroy_handle(vsk->dgHandle);
vsk->dgHandle = VMCI_INVALID_HANDLE;
}
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;
* 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;
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);
}
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;
}
{
ASSERT(vsk);
- return VMCIQPair_ConsumeBufReady(vsk->qpair);
+ return vmci_qpair_consume_buf_ready(vsk->qpair);
}
{
ASSERT(vsk);
- return VMCIQPair_ProduceFreeSpace(vsk->qpair);
+ return vmci_qpair_produce_free_space(vsk->qpair);
}
/* 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)) {
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? */
dg->payloadSize = len;
- err = VMCIDatagram_Send(dg);
+ err = vmci_datagram_send(dg);
kfree(dg);
if (err < 0) {
err = VSockVmci_ErrorToVSockError(err);
* 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;
}
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) {
}
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;
}
* 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) {
/*
* 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
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;
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. */
* 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;
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;;
* as freeSpace == ConsumeSize - bufferReady.
*/
- retval = VMCIQPair_ConsumeFreeSpace(vsk->qpair) > notifyLimit;
+ retval = vmci_qpair_consume_free_space(vsk->qpair) > notifyLimit;
if (retval) {
/*
if (dataRead) {
Atomic_MFence();
- freeSpace = VMCIQPair_ConsumeFreeSpace(vsk->qpair);
+ freeSpace = vmci_qpair_consume_free_space(vsk->qpair);
wasFull = freeSpace == copied;
if (wasFull) {
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 &&
#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_ */