]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Common source code merge
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:39 +0000 (11:22 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:39 +0000 (11:22 -0700)
- Update poll timer callback's to use 64bit integers for delay.
- Avoid creating substrs if unnecessary in Unicode_CompareRange.
- Vmxnet3: Add Receive Data Ring Support.
- Comment cleanup.

open-vm-tools/lib/include/poll.h
open-vm-tools/lib/include/vm_product_versions.h
open-vm-tools/lib/poll/poll.c
open-vm-tools/lib/pollGtk/pollGtk.c
open-vm-tools/lib/string/bsd_vsnwprintf.c
open-vm-tools/lib/unicode/unicodeSimpleOperations.c
open-vm-tools/modules/shared/vmxnet/vmxnet3_defs.h
open-vm-tools/services/plugins/dndcp/stringxx/string.cc

index 834535ce5f0e728441fcf8364417b4a1cb6c9d60..e64d4d45557371657c90d615d8d9eb099c20303f 100644 (file)
@@ -307,7 +307,7 @@ Bool Poll_CB_DeviceRemove(PollerFunction f,
 
 VMwareStatus Poll_CB_RTime(PollerFunction f,
                            void *clientData,
-                           int delay,  // microseconds
+                           int64 delay,   // microseconds
                            Bool periodic,
                            MXUserRecLock *lock);
 
index a1f8f7fdca387fd4bd22d95ef25110e0e0e31c8b..28ca5dbbbe848b5e2e1e072e40658f1bc859e769 100644 (file)
@@ -37,7 +37,7 @@
  * versioning is correct.
  */
 #if defined(VMX86_VIEWCLIENT)
-   #define PRODUCT_VERSION    3,0,0,PRODUCT_BUILD_NUMBER_NUMERIC
+   #define PRODUCT_VERSION    4,0,0,PRODUCT_BUILD_NUMBER_NUMERIC
 #elif defined(VMX86_VMRC) /* check VMX86_VMRC before VMX86_DESKTOP */
    #define PRODUCT_VERSION    8,0,0,PRODUCT_BUILD_NUMBER_NUMERIC   /* VMRC_VERSION_NUMBER below has to match this */
 #elif defined(VMX86_FLEX) /* check VMX86_FLEX before VMX86_DESKTOP */
 #define OVFTOOL_VERSION "4.1.0"
 #define VCSA_INSTALLER_VERSION "1.0.0"
 #define OVFTOOL_FILE_VERSION 4,1,0,PRODUCT_BUILD_NUMBER_NUMERIC
-#define VDM_CLIENT_VERSION "3.0.0"
+#define VDM_CLIENT_VERSION "4.0.0"
 #define VGAUTH_VERSION "e.x.p"
 #define COMMON_AGENT_VERSION "e.x.p"
 #define VIEWY_VERSION "e.x.p"
 #define RECOVERYLIBS_VERSION "2.0.0"
 #define PRECHECK_VERSION "e.x.p"
 #define VIEW_FEATUREPACK_VERSION "5.2.0"
-#define VIEW_CLIENT_VERSION_NUMBER "3.5.0"
-#define VIEW_CLIENT_VERSION "3.5.0"
+#define VIEW_CLIENT_VERSION_NUMBER "4.0.0"
+#define VIEW_CLIENT_VERSION "4.0.0"
 #define VHSESDK_VERSION "1.0.0"
-#define RDE_RFT_ALL_VERSION "3.5.0"
+#define RDE_RFT_ALL_VERSION "4.0.0"
 #define RDESDK_VERSION "2.0.0"
 #define RDESDKREL_VERSION "2.0.0"
 #define MKSVCHANDEV_VERSION "1.0.0"
index 8fe749d178369711a9023a2e78ad871afc254594..7ae5f96308f431b82a072b2358a0d190c5659227 100644 (file)
@@ -381,7 +381,7 @@ Poll_CB_DeviceRemove(PollerFunction f,
 VMwareStatus
 Poll_CB_RTime(PollerFunction f,
               void *clientData,
-              int info, //microsecs
+              int64 info, //microsecs
               Bool periodic,
               MXUserRecLock *lock)
 {
index 520b74c6685447d7ee2176d3ab24a414b1e84116..9403ec75a331be0e2688097a7bb65847d5c64cb1 100644 (file)
@@ -1111,16 +1111,17 @@ PollGtkCallback(PollClassSet classSet,   // IN
       ASSERT(info == 0);
       /* Fall-through */
    case POLL_REALTIME:
+      info = info / 1000;
       ASSERT(info == (uint32)info);
       ASSERT(info >= 0);
 
-      newEntry->event = info / 1000;
+      newEntry->event = info;
 
       /*
        * info is the delay in microseconds, but we need to pass in
        * a delay in milliseconds.
        */
-      newEntry->gtkInputId = g_timeout_add(info / 1000,
+      newEntry->gtkInputId = g_timeout_add(info,
                                            PollGtkBasicCallback,
                                            newEntry);
       g_hash_table_insert(poll->timerTable, (gpointer)(intptr_t)newEntry->gtkInputId,
index b78f95a6675cca0bb26bc08f72c524a4189e2e22..7d68f39d8f20440e919b1b96c9ce640acba1267a 100644 (file)
@@ -1061,7 +1061,11 @@ bsd_vsnwprintf(wchar_t **outBuf, size_t bufSize, const wchar_t *fmt0,
          if (flags & LONGINT) {
             /* Argument is wchar_t * */
             if ((cp = GETARG(wchar_t *)) == NULL)
+#if defined(__ANDROID__) || TARGET_OS_IPHONE
                cp = (wchar_t *)L"(null)";
+#else
+               cp = L"(null)";
+#endif
          } else {
             char *mbp;
             /* Argument is char * */
@@ -1069,7 +1073,11 @@ bsd_vsnwprintf(wchar_t **outBuf, size_t bufSize, const wchar_t *fmt0,
             if (convbuf!= NULL)
                free(convbuf);
             if ((mbp = GETARG(char *)) == NULL)
+#if defined(__ANDROID__) || TARGET_OS_IPHONE
                cp = (wchar_t *)L"(null)";
+#else
+               cp = L"(null)";
+#endif
             else {
                convbuf = BSDFmt_UTF8ToWChar(mbp, prec);
                if (convbuf == NULL) {
index eae5a929a0a6c750478a80e00bd5f5c1ed59067d..7b29b2a33510daebbb8ae2eb50802e933a3dbdec 100644 (file)
@@ -105,8 +105,8 @@ Unicode_CompareRange(const char *str1,         // IN:
    int result = -1;
    char *substr1 = NULL;
    char *substr2 = NULL;
-   utf16_t *substr1UTF16 = NULL;
-   utf16_t *substr2UTF16 = NULL;
+   utf16_t *str1UTF16 = NULL;
+   utf16_t *str2UTF16 = NULL;
    UnicodeIndex i = 0;
    UnicodeIndex utf16Index;
    utf16_t codeUnit1;
@@ -120,27 +120,33 @@ Unicode_CompareRange(const char *str1,         // IN:
     * care, and it's just easier to search UTF-16.)
     */
 
-   substr1 = Unicode_Substr(str1, str1Start, str1Length);
-   if (!substr1) {
-      goto out;
+   if (str1Start != 0 || str1Length != -1) {
+      substr1 = Unicode_Substr(str1, str1Start, str1Length);
+      if (!substr1) {
+         goto out;
+      }
+      str1 = substr1;
    }
 
-   substr2 = Unicode_Substr(str2, str2Start, str2Length);
-   if (!substr2) {
-      goto out;
+   if (str2Start != 0 || str2Length != -1) {
+      substr2 = Unicode_Substr(str2, str2Start, str2Length);
+      if (!substr2) {
+         goto out;
+      }
+      str2 = substr2;
    }
 
    /*
     * XXX TODO: Need to normalize the incoming strings to NFC or NFD.
     */
 
-   substr1UTF16 = Unicode_GetAllocUTF16(substr1);
-   if (!substr1UTF16) {
+   str1UTF16 = Unicode_GetAllocUTF16(str1);
+   if (!str1UTF16) {
       goto out;
    }
 
-   substr2UTF16 = Unicode_GetAllocUTF16(substr2);
-   if (!substr2UTF16) {
+   str2UTF16 = Unicode_GetAllocUTF16(str2);
+   if (!str2UTF16) {
       goto out;
    }
 
@@ -150,8 +156,8 @@ Unicode_CompareRange(const char *str1,         // IN:
     */
 
    while (TRUE) {
-      codeUnit1 = *(substr1UTF16 + i);
-      codeUnit2 = *(substr2UTF16 + i);
+      codeUnit1 = *(str1UTF16 + i);
+      codeUnit2 = *(str2UTF16 + i);
 
       /*
        * TODO: Simple case folding doesn't handle the situation where more
@@ -186,23 +192,23 @@ Unicode_CompareRange(const char *str1,         // IN:
     */
 
    if (U16_IS_SURROGATE(codeUnit1)) {
-      ssize_t substrUTF16Len = Unicode_UTF16Strlen(substr1UTF16);
+      ssize_t strUTF16Len = Unicode_UTF16Strlen(str1UTF16);
 
       // U16_NEXT modifies the index, so let it work on a copy.
       utf16Index = i;
 
       // Decode the surrogate if needed.
-      U16_NEXT(substr1UTF16, utf16Index, substrUTF16Len, codePoint1);
+      U16_NEXT(str1UTF16, utf16Index, strUTF16Len, codePoint1);
    } else {
       // Not a surrogate?  Then the code point value is the code unit.
       codePoint1 = codeUnit1;
    }
 
    if (U16_IS_SURROGATE(codeUnit2)) {
-      ssize_t substrUTF16Len = Unicode_UTF16Strlen(substr2UTF16);
+      ssize_t strUTF16Len = Unicode_UTF16Strlen(str2UTF16);
 
       utf16Index = i;
-      U16_NEXT(substr2UTF16, utf16Index, substrUTF16Len, codePoint2);
+      U16_NEXT(str2UTF16, utf16Index, strUTF16Len, codePoint2);
    } else {
       codePoint2 = codeUnit2;
    }
@@ -216,9 +222,9 @@ Unicode_CompareRange(const char *str1,         // IN:
       NOT_REACHED();
    }
 
-  out:
-   free(substr1UTF16);
-   free(substr2UTF16);
+out:
+   free(str1UTF16);
+   free(str2UTF16);
 
    free(substr1);
    free(substr2);
@@ -314,7 +320,7 @@ Unicode_FindSubstrInRange(const char *str,               // IN:
       index = strStart;
       goto bail;
    }
-  
+
    /*
     * Attempt to find the first occurence of the search string in the string
     * to be searched.
@@ -439,7 +445,7 @@ Unicode_FindLastSubstrInRange(const char *str,               // IN:
       index = strStart;
       goto bail;
    }
-  
+
    /*
     * Attempt to find the last occurence of the search string in the string
     * to be searched.
@@ -617,7 +623,7 @@ Unicode_ReplaceRange(const char *dest,         // IN:
  *      Allocates and returns a new string containing the 'first' followed by
  *      all the unicode strings specified as optional arguments. Appending
  *      ceases when a NULL pointer is detected.
- * 
+ *
  * Results:
  *      The newly-allocated string.  Caller must free with free.
  *
@@ -675,12 +681,12 @@ Unicode_Join(const char *first,  // IN:
  */
 
 char *
-Unicode_Format(const char *fmt,        // IN: the format
-              ...)             // IN: the arguments
+Unicode_Format(const char *fmt, // IN: the format
+               ...)             // IN: the arguments
 {
    va_list args;
    char *p;
-   
+
    va_start(args, fmt);
    p = Str_Vasprintf(NULL, fmt, args);
    va_end(args);
index d593265c8ee223fe3f084f2d0a699d49a4fe5755..c108648c799f464097efe9a2fae279fa0818d0f8 100644 (file)
@@ -229,6 +229,8 @@ struct Vmxnet3_TxDataDesc {
 #include "vmware_pack_end.h"
 Vmxnet3_TxDataDesc;
 
+typedef uint8 Vmxnet3_RxDataDesc;
+
 #define VMXNET3_TCD_GEN_SHIFT  31
 #define VMXNET3_TCD_GEN_SIZE   1
 #define VMXNET3_TCD_TXIDX_SHIFT        0
@@ -443,6 +445,10 @@ typedef union Vmxnet3_GenericDesc {
 #define VMXNET3_RING_SIZE_ALIGN 32
 #define VMXNET3_RING_SIZE_MASK  (VMXNET3_RING_SIZE_ALIGN - 1)
 
+/* Rx Data Ring buffer size must be a multiple of 64 bytes */
+#define VMXNET3_RXDATA_DESC_SIZE_ALIGN 64
+#define VMXNET3_RXDATA_DESC_SIZE_MASK  (VMXNET3_RXDATA_DESC_SIZE_ALIGN - 1)
+
 /* Max ring size */
 #define VMXNET3_TX_RING_MAX_SIZE   4096
 #define VMXNET3_TC_RING_MAX_SIZE   4096
@@ -450,6 +456,9 @@ typedef union Vmxnet3_GenericDesc {
 #define VMXNET3_RX_RING2_MAX_SIZE  2048
 #define VMXNET3_RC_RING_MAX_SIZE   8192
 
+/* Large enough to accommodate typical payload + encap + extension header */
+#define VMXNET3_RXDATA_DESC_MAX_SIZE 2048
+
 /* a list of reasons for queue stop */
 
 #define VMXNET3_ERR_NOEOP        0x80000000  /* cannot find the EOP desc of a pkt */
@@ -560,12 +569,14 @@ struct Vmxnet3_RxQueueConf {
    __le64    rxRingBasePA[2];
    __le64    compRingBasePA;
    __le64    ddPA;            /* driver data */
-   __le64    reserved;
+   __le64    rxDataRingBasePA;
    __le32    rxRingSize[2];   /* # of rx desc */
    __le32    compRingSize;    /* # of rx comp desc */
    __le32    ddLen;           /* size of driver data */
    uint8     intrIdx;
-   uint8     _pad[7];
+   uint8     _pad1[1];
+   __le16    rxDataRingDescSize; /* size of rx data ring buffer */
+   uint8     _pad2[4];
 }
 #include "vmware_pack_end.h"
 Vmxnet3_RxQueueConf;
index 7743fe16045f107459cb79dffeaed38be51ec25b..23c721bcd3cc8a6be71249aedf92af251c16a94f 100644 (file)
@@ -1594,7 +1594,7 @@ string::find_last_not_of(value_type uc,   // IN
 
 string
 string::substr(size_type start, // IN
-               size_type len)   // IN
+               size_type len)   // IN: The substring length in code points.
    const
 {
    return string(mUstr.substr(start, len));