From: Oliver Kurth Date: Fri, 15 Sep 2017 18:22:39 +0000 (-0700) Subject: Common source code merge X-Git-Tag: stable-10.2.0~745 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc23a48e0ea22921099ea8af8693f553a1ade5f1;p=thirdparty%2Fopen-vm-tools.git Common source code merge - 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. --- diff --git a/open-vm-tools/lib/include/poll.h b/open-vm-tools/lib/include/poll.h index 834535ce5..e64d4d455 100644 --- a/open-vm-tools/lib/include/poll.h +++ b/open-vm-tools/lib/include/poll.h @@ -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); diff --git a/open-vm-tools/lib/include/vm_product_versions.h b/open-vm-tools/lib/include/vm_product_versions.h index a1f8f7fdc..28ca5dbbb 100644 --- a/open-vm-tools/lib/include/vm_product_versions.h +++ b/open-vm-tools/lib/include/vm_product_versions.h @@ -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 */ @@ -224,7 +224,7 @@ #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" @@ -235,10 +235,10 @@ #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" diff --git a/open-vm-tools/lib/poll/poll.c b/open-vm-tools/lib/poll/poll.c index 8fe749d17..7ae5f9630 100644 --- a/open-vm-tools/lib/poll/poll.c +++ b/open-vm-tools/lib/poll/poll.c @@ -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) { diff --git a/open-vm-tools/lib/pollGtk/pollGtk.c b/open-vm-tools/lib/pollGtk/pollGtk.c index 520b74c66..9403ec75a 100644 --- a/open-vm-tools/lib/pollGtk/pollGtk.c +++ b/open-vm-tools/lib/pollGtk/pollGtk.c @@ -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, diff --git a/open-vm-tools/lib/string/bsd_vsnwprintf.c b/open-vm-tools/lib/string/bsd_vsnwprintf.c index b78f95a66..7d68f39d8 100644 --- a/open-vm-tools/lib/string/bsd_vsnwprintf.c +++ b/open-vm-tools/lib/string/bsd_vsnwprintf.c @@ -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) { diff --git a/open-vm-tools/lib/unicode/unicodeSimpleOperations.c b/open-vm-tools/lib/unicode/unicodeSimpleOperations.c index eae5a929a..7b29b2a33 100644 --- a/open-vm-tools/lib/unicode/unicodeSimpleOperations.c +++ b/open-vm-tools/lib/unicode/unicodeSimpleOperations.c @@ -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); diff --git a/open-vm-tools/modules/shared/vmxnet/vmxnet3_defs.h b/open-vm-tools/modules/shared/vmxnet/vmxnet3_defs.h index d593265c8..c108648c7 100644 --- a/open-vm-tools/modules/shared/vmxnet/vmxnet3_defs.h +++ b/open-vm-tools/modules/shared/vmxnet/vmxnet3_defs.h @@ -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; diff --git a/open-vm-tools/services/plugins/dndcp/stringxx/string.cc b/open-vm-tools/services/plugins/dndcp/stringxx/string.cc index 7743fe160..23c721bcd 100644 --- a/open-vm-tools/services/plugins/dndcp/stringxx/string.cc +++ b/open-vm-tools/services/plugins/dndcp/stringxx/string.cc @@ -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));