^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: MIT */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * VirtualBox Shared Folders: host interface definition.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2006-2018 Oracle Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #ifndef SHFL_HOSTINTF_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #define SHFL_HOSTINTF_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/vbox_vmmdev_types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) /* The max in/out buffer size for a FN_READ or FN_WRITE call */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define SHFL_MAX_RW_COUNT (16 * SZ_1M)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * Structures shared between guest and the service
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * can be relocated and use offsets to point to variable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * length parts.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * Shared folders protocol works with handles.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * Before doing any action on a file system object,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * one have to obtain the object handle via a SHFL_FN_CREATE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * request. A handle must be closed with SHFL_FN_CLOSE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) SHFL_FN_QUERY_MAPPINGS = 1, /* Query mappings changes. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) SHFL_FN_QUERY_MAP_NAME = 2, /* Query map name. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) SHFL_FN_CREATE = 3, /* Open/create object. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) SHFL_FN_CLOSE = 4, /* Close object handle. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) SHFL_FN_READ = 5, /* Read object content. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) SHFL_FN_WRITE = 6, /* Write new object content. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) SHFL_FN_LOCK = 7, /* Lock/unlock a range in the object. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) SHFL_FN_LIST = 8, /* List object content. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) SHFL_FN_INFORMATION = 9, /* Query/set object information. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) /* Note function number 10 is not used! */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) SHFL_FN_REMOVE = 11, /* Remove object */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) SHFL_FN_MAP_FOLDER_OLD = 12, /* Map folder (legacy) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) SHFL_FN_UNMAP_FOLDER = 13, /* Unmap folder */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) SHFL_FN_RENAME = 14, /* Rename object */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) SHFL_FN_FLUSH = 15, /* Flush file */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) SHFL_FN_SET_UTF8 = 16, /* Select UTF8 filename encoding */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) SHFL_FN_MAP_FOLDER = 17, /* Map folder */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) SHFL_FN_READLINK = 18, /* Read symlink dest (as of VBox 4.0) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) SHFL_FN_SYMLINK = 19, /* Create symlink (as of VBox 4.0) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) SHFL_FN_SET_SYMLINKS = 20, /* Ask host to show symlinks (4.0+) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) /* Root handles for a mapping are of type u32, Root handles are unique. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) #define SHFL_ROOT_NIL UINT_MAX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) /* Shared folders handle for an opened object are of type u64. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) #define SHFL_HANDLE_NIL ULLONG_MAX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) /* Hardcoded maximum length (in chars) of a shared folder name. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #define SHFL_MAX_LEN (256)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) /* Hardcoded maximum number of shared folder mapping available to the guest. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #define SHFL_MAX_MAPPINGS (64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) /** Shared folder string buffer structure. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) struct shfl_string {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) /** Allocated size of the string member in bytes. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) u16 size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) /** Length of string without trailing nul in bytes. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) u16 length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) /** UTF-8 or UTF-16 string. Nul terminated. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) u8 utf8[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) u16 utf16[1];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) u16 ucs2[1]; /* misnomer, use utf16. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) } string;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) VMMDEV_ASSERT_SIZE(shfl_string, 6);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) /* The size of shfl_string w/o the string part. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) #define SHFLSTRING_HEADER_SIZE 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) /* Calculate size of the string. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) static inline u32 shfl_string_buf_size(const struct shfl_string *string)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) return string ? SHFLSTRING_HEADER_SIZE + string->size : 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) /* Set user id on execution (S_ISUID). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) #define SHFL_UNIX_ISUID 0004000U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) /* Set group id on execution (S_ISGID). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) #define SHFL_UNIX_ISGID 0002000U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) /* Sticky bit (S_ISVTX / S_ISTXT). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) #define SHFL_UNIX_ISTXT 0001000U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) /* Owner readable (S_IRUSR). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) #define SHFL_UNIX_IRUSR 0000400U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) /* Owner writable (S_IWUSR). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) #define SHFL_UNIX_IWUSR 0000200U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) /* Owner executable (S_IXUSR). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) #define SHFL_UNIX_IXUSR 0000100U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) /* Group readable (S_IRGRP). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) #define SHFL_UNIX_IRGRP 0000040U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) /* Group writable (S_IWGRP). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) #define SHFL_UNIX_IWGRP 0000020U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) /* Group executable (S_IXGRP). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) #define SHFL_UNIX_IXGRP 0000010U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) /* Other readable (S_IROTH). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) #define SHFL_UNIX_IROTH 0000004U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) /* Other writable (S_IWOTH). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) #define SHFL_UNIX_IWOTH 0000002U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) /* Other executable (S_IXOTH). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) #define SHFL_UNIX_IXOTH 0000001U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) /* Named pipe (fifo) (S_IFIFO). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) #define SHFL_TYPE_FIFO 0010000U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) /* Character device (S_IFCHR). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) #define SHFL_TYPE_DEV_CHAR 0020000U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) /* Directory (S_IFDIR). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) #define SHFL_TYPE_DIRECTORY 0040000U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) /* Block device (S_IFBLK). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) #define SHFL_TYPE_DEV_BLOCK 0060000U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) /* Regular file (S_IFREG). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) #define SHFL_TYPE_FILE 0100000U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) /* Symbolic link (S_IFLNK). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) #define SHFL_TYPE_SYMLINK 0120000U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) /* Socket (S_IFSOCK). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) #define SHFL_TYPE_SOCKET 0140000U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) /* Whiteout (S_IFWHT). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) #define SHFL_TYPE_WHITEOUT 0160000U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) /* Type mask (S_IFMT). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) #define SHFL_TYPE_MASK 0170000U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) /* Checks the mode flags indicate a directory (S_ISDIR). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) #define SHFL_IS_DIRECTORY(m) (((m) & SHFL_TYPE_MASK) == SHFL_TYPE_DIRECTORY)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) /* Checks the mode flags indicate a symbolic link (S_ISLNK). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) #define SHFL_IS_SYMLINK(m) (((m) & SHFL_TYPE_MASK) == SHFL_TYPE_SYMLINK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) /** The available additional information in a shfl_fsobjattr object. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) enum shfl_fsobjattr_add {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) /** No additional information is available / requested. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) SHFLFSOBJATTRADD_NOTHING = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) * The additional unix attributes (shfl_fsobjattr::u::unix_attr) are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) * available / requested.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) SHFLFSOBJATTRADD_UNIX,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) * The additional extended attribute size (shfl_fsobjattr::u::size) is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) * available / requested.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) SHFLFSOBJATTRADD_EASIZE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) * The last valid item (inclusive).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) * The valid range is SHFLFSOBJATTRADD_NOTHING thru
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) * SHFLFSOBJATTRADD_LAST.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) SHFLFSOBJATTRADD_LAST = SHFLFSOBJATTRADD_EASIZE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) /** The usual 32-bit hack. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) SHFLFSOBJATTRADD_32BIT_SIZE_HACK = 0x7fffffff
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) * Additional unix Attributes, these are available when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) * shfl_fsobjattr.additional == SHFLFSOBJATTRADD_UNIX.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) struct shfl_fsobjattr_unix {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) * The user owning the filesystem object (st_uid).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) * This field is ~0U if not supported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) u32 uid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) * The group the filesystem object is assigned (st_gid).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) * This field is ~0U if not supported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) u32 gid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) * Number of hard links to this filesystem object (st_nlink).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) * This field is 1 if the filesystem doesn't support hardlinking or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) * the information isn't available.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) u32 hardlinks;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) * The device number of the device which this filesystem object resides
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) * on (st_dev). This field is 0 if this information is not available.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) u32 inode_id_device;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) * The unique identifier (within the filesystem) of this filesystem
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) * object (st_ino). Together with inode_id_device, this field can be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) * used as a OS wide unique id, when both their values are not 0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) * This field is 0 if the information is not available.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) u64 inode_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) * User flags (st_flags).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) * This field is 0 if this information is not available.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) u32 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) * The current generation number (st_gen).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) * This field is 0 if this information is not available.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) u32 generation_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) * The device number of a char. or block device type object (st_rdev).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) * This field is 0 if the file isn't a char. or block device or when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) * the OS doesn't use the major+minor device idenfication scheme.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) u32 device;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) /** Extended attribute size. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) struct shfl_fsobjattr_easize {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) /** Size of EAs. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) s64 cb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) /** Shared folder filesystem object attributes. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) struct shfl_fsobjattr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) /** Mode flags (st_mode). SHFL_UNIX_*, SHFL_TYPE_*, and SHFL_DOS_*. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) u32 mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) /** The additional attributes available. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) enum shfl_fsobjattr_add additional;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) * Additional attributes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) * Unless explicitly specified to an API, the API can provide additional
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) * data as it is provided by the underlying OS.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) struct shfl_fsobjattr_unix unix_attr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) struct shfl_fsobjattr_easize size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) } __packed u;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) VMMDEV_ASSERT_SIZE(shfl_fsobjattr, 44);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) struct shfl_timespec {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) s64 ns_relative_to_unix_epoch;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) /** Filesystem object information structure. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) struct shfl_fsobjinfo {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) * Logical size (st_size).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) * For normal files this is the size of the file.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) * For symbolic links, this is the length of the path name contained
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) * in the symbolic link.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) * For other objects this fields needs to be specified.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) s64 size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) /** Disk allocation size (st_blocks * DEV_BSIZE). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) s64 allocated;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) /** Time of last access (st_atime). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) struct shfl_timespec access_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) /** Time of last data modification (st_mtime). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) struct shfl_timespec modification_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) * Time of last status change (st_ctime).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) * If not available this is set to modification_time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) struct shfl_timespec change_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) * Time of file birth (st_birthtime).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) * If not available this is set to change_time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) struct shfl_timespec birth_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) /** Attributes. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) struct shfl_fsobjattr attr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) VMMDEV_ASSERT_SIZE(shfl_fsobjinfo, 92);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) * result of an open/create request.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) * Along with handle value the result code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) * identifies what has happened while
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) * trying to open the object.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) enum shfl_create_result {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) SHFL_NO_RESULT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) /** Specified path does not exist. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) SHFL_PATH_NOT_FOUND,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) /** Path to file exists, but the last component does not. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) SHFL_FILE_NOT_FOUND,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) /** File already exists and either has been opened or not. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) SHFL_FILE_EXISTS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) /** New file was created. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) SHFL_FILE_CREATED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) /** Existing file was replaced or overwritten. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) SHFL_FILE_REPLACED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) /* No flags. Initialization value. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) #define SHFL_CF_NONE (0x00000000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) * Only lookup the object, do not return a handle. When this is set all other
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) * flags are ignored.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) #define SHFL_CF_LOOKUP (0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) * Open parent directory of specified object.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) * Useful for the corresponding Windows FSD flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) * and for opening paths like \\dir\\*.* to search the 'dir'.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) #define SHFL_CF_OPEN_TARGET_DIRECTORY (0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) /* Create/open a directory. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) #define SHFL_CF_DIRECTORY (0x00000004)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) * Open/create action to do if object exists
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) * and if the object does not exists.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) * REPLACE file means atomically DELETE and CREATE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) * OVERWRITE file means truncating the file to 0 and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) * setting new size.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) * When opening an existing directory REPLACE and OVERWRITE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) * actions are considered invalid, and cause returning
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) * FILE_EXISTS with NIL handle.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) #define SHFL_CF_ACT_MASK_IF_EXISTS (0x000000f0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) #define SHFL_CF_ACT_MASK_IF_NEW (0x00000f00)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) /* What to do if object exists. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) #define SHFL_CF_ACT_OPEN_IF_EXISTS (0x00000000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) #define SHFL_CF_ACT_FAIL_IF_EXISTS (0x00000010)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) #define SHFL_CF_ACT_REPLACE_IF_EXISTS (0x00000020)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) #define SHFL_CF_ACT_OVERWRITE_IF_EXISTS (0x00000030)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) /* What to do if object does not exist. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) #define SHFL_CF_ACT_CREATE_IF_NEW (0x00000000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) #define SHFL_CF_ACT_FAIL_IF_NEW (0x00000100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) /* Read/write requested access for the object. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) #define SHFL_CF_ACCESS_MASK_RW (0x00003000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) /* No access requested. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) #define SHFL_CF_ACCESS_NONE (0x00000000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) /* Read access requested. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) #define SHFL_CF_ACCESS_READ (0x00001000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) /* Write access requested. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) #define SHFL_CF_ACCESS_WRITE (0x00002000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) /* Read/Write access requested. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) #define SHFL_CF_ACCESS_READWRITE (0x00003000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) /* Requested share access for the object. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) #define SHFL_CF_ACCESS_MASK_DENY (0x0000c000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) /* Allow any access. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) #define SHFL_CF_ACCESS_DENYNONE (0x00000000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) /* Do not allow read. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) #define SHFL_CF_ACCESS_DENYREAD (0x00004000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) /* Do not allow write. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) #define SHFL_CF_ACCESS_DENYWRITE (0x00008000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) /* Do not allow access. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) #define SHFL_CF_ACCESS_DENYALL (0x0000c000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) /* Requested access to attributes of the object. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) #define SHFL_CF_ACCESS_MASK_ATTR (0x00030000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) /* No access requested. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) #define SHFL_CF_ACCESS_ATTR_NONE (0x00000000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) /* Read access requested. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) #define SHFL_CF_ACCESS_ATTR_READ (0x00010000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) /* Write access requested. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) #define SHFL_CF_ACCESS_ATTR_WRITE (0x00020000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) /* Read/Write access requested. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) #define SHFL_CF_ACCESS_ATTR_READWRITE (0x00030000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) * The file is opened in append mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) * Ignored if SHFL_CF_ACCESS_WRITE is not set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) #define SHFL_CF_ACCESS_APPEND (0x00040000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) /** Create parameters buffer struct for SHFL_FN_CREATE call */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) struct shfl_createparms {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) /** Returned handle of opened object. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) u64 handle;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) /** Returned result of the operation */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) enum shfl_create_result result;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) /** SHFL_CF_* */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) u32 create_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) * Attributes of object to create and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) * returned actual attributes of opened/created object.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) struct shfl_fsobjinfo info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) /** Shared Folder directory information */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) struct shfl_dirinfo {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) /** Full information about the object. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) struct shfl_fsobjinfo info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) * The length of the short field (number of UTF16 chars).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) * It is 16-bit for reasons of alignment.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) u16 short_name_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) * The short name for 8.3 compatibility.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) * Empty string if not available.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) u16 short_name[14];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) struct shfl_string name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) /** Shared folder filesystem properties. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) struct shfl_fsproperties {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) * The maximum size of a filesystem object name.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) * This does not include the '\\0'.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) u32 max_component_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) * True if the filesystem is remote.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) * False if the filesystem is local.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) bool remote;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) * True if the filesystem is case sensitive.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) * False if the filesystem is case insensitive.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) bool case_sensitive;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) * True if the filesystem is mounted read only.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) * False if the filesystem is mounted read write.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) bool read_only;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) * True if the filesystem can encode unicode object names.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) * False if it can't.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) bool supports_unicode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) * True if the filesystem is compresses.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) * False if it isn't or we don't know.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) bool compressed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) * True if the filesystem compresses of individual files.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) * False if it doesn't or we don't know.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) bool file_compression;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) VMMDEV_ASSERT_SIZE(shfl_fsproperties, 12);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) struct shfl_volinfo {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) s64 total_allocation_bytes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) s64 available_allocation_bytes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) u32 bytes_per_allocation_unit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) u32 bytes_per_sector;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) u32 serial;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) struct shfl_fsproperties properties;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) /** SHFL_FN_MAP_FOLDER Parameters structure. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) struct shfl_map_folder {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) * pointer, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) * Points to struct shfl_string buffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) struct vmmdev_hgcm_function_parameter path;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) * pointer, out: SHFLROOT (u32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) * Root handle of the mapping which name is queried.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) struct vmmdev_hgcm_function_parameter root;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) * pointer, in: UTF16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) * Path delimiter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) struct vmmdev_hgcm_function_parameter delimiter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) * pointer, in: SHFLROOT (u32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) * Case senstive flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) struct vmmdev_hgcm_function_parameter case_sensitive;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) /* Number of parameters */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) #define SHFL_CPARMS_MAP_FOLDER (4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) /** SHFL_FN_UNMAP_FOLDER Parameters structure. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) struct shfl_unmap_folder {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) * pointer, in: SHFLROOT (u32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) * Root handle of the mapping which name is queried.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) struct vmmdev_hgcm_function_parameter root;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) /* Number of parameters */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) #define SHFL_CPARMS_UNMAP_FOLDER (1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) /** SHFL_FN_CREATE Parameters structure. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) struct shfl_create {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535) * pointer, in: SHFLROOT (u32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) * Root handle of the mapping which name is queried.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538) struct vmmdev_hgcm_function_parameter root;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) * pointer, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) * Points to struct shfl_string buffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) struct vmmdev_hgcm_function_parameter path;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547) * pointer, in/out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) * Points to struct shfl_createparms buffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) struct vmmdev_hgcm_function_parameter parms;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554) /* Number of parameters */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) #define SHFL_CPARMS_CREATE (3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) /** SHFL_FN_CLOSE Parameters structure. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) struct shfl_close {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) * pointer, in: SHFLROOT (u32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) * Root handle of the mapping which name is queried.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) struct vmmdev_hgcm_function_parameter root;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) * value64, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) * SHFLHANDLE (u64) of object to close.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) struct vmmdev_hgcm_function_parameter handle;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) /* Number of parameters */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) #define SHFL_CPARMS_CLOSE (2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) /** SHFL_FN_READ Parameters structure. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579) struct shfl_read {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) * pointer, in: SHFLROOT (u32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582) * Root handle of the mapping which name is queried.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584) struct vmmdev_hgcm_function_parameter root;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587) * value64, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) * SHFLHANDLE (u64) of object to read from.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590) struct vmmdev_hgcm_function_parameter handle;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593) * value64, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594) * Offset to read from.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) struct vmmdev_hgcm_function_parameter offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) * value64, in/out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600) * Bytes to read/How many were read.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602) struct vmmdev_hgcm_function_parameter cb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605) * pointer, out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606) * Buffer to place data to.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608) struct vmmdev_hgcm_function_parameter buffer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612) /* Number of parameters */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613) #define SHFL_CPARMS_READ (5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616) /** SHFL_FN_WRITE Parameters structure. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617) struct shfl_write {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 618) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 619) * pointer, in: SHFLROOT (u32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 620) * Root handle of the mapping which name is queried.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 621) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 622) struct vmmdev_hgcm_function_parameter root;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 623)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 624) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 625) * value64, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 626) * SHFLHANDLE (u64) of object to write to.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 627) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 628) struct vmmdev_hgcm_function_parameter handle;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 629)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 630) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 631) * value64, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 632) * Offset to write to.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 633) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 634) struct vmmdev_hgcm_function_parameter offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 635)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 636) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 637) * value64, in/out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 638) * Bytes to write/How many were written.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 639) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 640) struct vmmdev_hgcm_function_parameter cb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 641)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 642) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 643) * pointer, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 644) * Data to write.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 645) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 646) struct vmmdev_hgcm_function_parameter buffer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 647)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 648) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 649)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 650) /* Number of parameters */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 651) #define SHFL_CPARMS_WRITE (5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 652)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 653)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 654) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 655) * SHFL_FN_LIST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 656) * Listing information includes variable length RTDIRENTRY[EX] structures.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 657) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 658)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 659) #define SHFL_LIST_NONE 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 660) #define SHFL_LIST_RETURN_ONE 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 661)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 662) /** SHFL_FN_LIST Parameters structure. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 663) struct shfl_list {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 664) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 665) * pointer, in: SHFLROOT (u32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 666) * Root handle of the mapping which name is queried.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 667) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 668) struct vmmdev_hgcm_function_parameter root;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 669)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 670) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 671) * value64, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 672) * SHFLHANDLE (u64) of object to be listed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 673) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 674) struct vmmdev_hgcm_function_parameter handle;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 675)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 676) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 677) * value32, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 678) * List flags SHFL_LIST_*.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 679) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 680) struct vmmdev_hgcm_function_parameter flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 681)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 682) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 683) * value32, in/out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 684) * Bytes to be used for listing information/How many bytes were used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 685) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 686) struct vmmdev_hgcm_function_parameter cb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 687)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 688) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 689) * pointer, in/optional
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 690) * Points to struct shfl_string buffer that specifies a search path.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 691) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 692) struct vmmdev_hgcm_function_parameter path;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 693)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 694) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 695) * pointer, out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 696) * Buffer to place listing information to. (struct shfl_dirinfo)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 697) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 698) struct vmmdev_hgcm_function_parameter buffer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 699)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 700) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 701) * value32, in/out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 702) * Indicates a key where the listing must be resumed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 703) * in: 0 means start from begin of object.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 704) * out: 0 means listing completed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 705) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 706) struct vmmdev_hgcm_function_parameter resume_point;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 707)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 708) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 709) * pointer, out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 710) * Number of files returned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 711) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 712) struct vmmdev_hgcm_function_parameter file_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 713) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 714)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 715) /* Number of parameters */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 716) #define SHFL_CPARMS_LIST (8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 717)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 718)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 719) /** SHFL_FN_READLINK Parameters structure. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 720) struct shfl_readLink {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 721) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 722) * pointer, in: SHFLROOT (u32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 723) * Root handle of the mapping which name is queried.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 724) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 725) struct vmmdev_hgcm_function_parameter root;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 726)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 727) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 728) * pointer, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 729) * Points to struct shfl_string buffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 730) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 731) struct vmmdev_hgcm_function_parameter path;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 732)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 733) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 734) * pointer, out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 735) * Buffer to place data to.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 736) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 737) struct vmmdev_hgcm_function_parameter buffer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 738)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 739) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 740)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 741) /* Number of parameters */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 742) #define SHFL_CPARMS_READLINK (3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 743)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 744)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 745) /* SHFL_FN_INFORMATION */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 746)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 747) /* Mask of Set/Get bit. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 748) #define SHFL_INFO_MODE_MASK (0x1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 749) /* Get information */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 750) #define SHFL_INFO_GET (0x0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 751) /* Set information */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 752) #define SHFL_INFO_SET (0x1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 753)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 754) /* Get name of the object. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 755) #define SHFL_INFO_NAME (0x2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 756) /* Set size of object (extend/trucate); only applies to file objects */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 757) #define SHFL_INFO_SIZE (0x4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 758) /* Get/Set file object info. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 759) #define SHFL_INFO_FILE (0x8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 760) /* Get volume information. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 761) #define SHFL_INFO_VOLUME (0x10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 762)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 763) /** SHFL_FN_INFORMATION Parameters structure. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 764) struct shfl_information {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 765) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 766) * pointer, in: SHFLROOT (u32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 767) * Root handle of the mapping which name is queried.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 768) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 769) struct vmmdev_hgcm_function_parameter root;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 770)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 771) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 772) * value64, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 773) * SHFLHANDLE (u64) of object to be listed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 774) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 775) struct vmmdev_hgcm_function_parameter handle;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 776)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 777) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 778) * value32, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 779) * SHFL_INFO_*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 780) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 781) struct vmmdev_hgcm_function_parameter flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 782)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 783) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 784) * value32, in/out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 785) * Bytes to be used for information/How many bytes were used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 786) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 787) struct vmmdev_hgcm_function_parameter cb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 788)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 789) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 790) * pointer, in/out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 791) * Information to be set/get (shfl_fsobjinfo or shfl_string). Do not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 792) * forget to set the shfl_fsobjinfo::attr::additional for a get
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 793) * operation as well.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 794) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 795) struct vmmdev_hgcm_function_parameter info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 796)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 797) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 798)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 799) /* Number of parameters */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 800) #define SHFL_CPARMS_INFORMATION (5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 801)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 802)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 803) /* SHFL_FN_REMOVE */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 804)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 805) #define SHFL_REMOVE_FILE (0x1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 806) #define SHFL_REMOVE_DIR (0x2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 807) #define SHFL_REMOVE_SYMLINK (0x4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 808)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 809) /** SHFL_FN_REMOVE Parameters structure. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 810) struct shfl_remove {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 811) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 812) * pointer, in: SHFLROOT (u32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 813) * Root handle of the mapping which name is queried.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 814) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 815) struct vmmdev_hgcm_function_parameter root;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 816)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 817) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 818) * pointer, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 819) * Points to struct shfl_string buffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 820) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 821) struct vmmdev_hgcm_function_parameter path;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 822)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 823) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 824) * value32, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 825) * remove flags (file/directory)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 826) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 827) struct vmmdev_hgcm_function_parameter flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 828)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 829) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 830)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 831) #define SHFL_CPARMS_REMOVE (3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 832)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 833)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 834) /* SHFL_FN_RENAME */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 835)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 836) #define SHFL_RENAME_FILE (0x1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 837) #define SHFL_RENAME_DIR (0x2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 838) #define SHFL_RENAME_REPLACE_IF_EXISTS (0x4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 839)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 840) /** SHFL_FN_RENAME Parameters structure. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 841) struct shfl_rename {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 842) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 843) * pointer, in: SHFLROOT (u32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 844) * Root handle of the mapping which name is queried.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 845) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 846) struct vmmdev_hgcm_function_parameter root;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 847)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 848) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 849) * pointer, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 850) * Points to struct shfl_string src.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 851) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 852) struct vmmdev_hgcm_function_parameter src;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 853)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 854) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 855) * pointer, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 856) * Points to struct shfl_string dest.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 857) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 858) struct vmmdev_hgcm_function_parameter dest;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 859)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 860) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 861) * value32, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 862) * rename flags (file/directory)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 863) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 864) struct vmmdev_hgcm_function_parameter flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 865)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 866) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 867)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 868) #define SHFL_CPARMS_RENAME (4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 869)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 870)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 871) /** SHFL_FN_SYMLINK Parameters structure. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 872) struct shfl_symlink {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 873) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 874) * pointer, in: SHFLROOT (u32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 875) * Root handle of the mapping which name is queried.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 876) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 877) struct vmmdev_hgcm_function_parameter root;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 878)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 879) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 880) * pointer, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 881) * Points to struct shfl_string of path for the new symlink.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 882) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 883) struct vmmdev_hgcm_function_parameter new_path;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 884)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 885) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 886) * pointer, in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 887) * Points to struct shfl_string of destination for symlink.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 888) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 889) struct vmmdev_hgcm_function_parameter old_path;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 890)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 891) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 892) * pointer, out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 893) * Information about created symlink.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 894) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 895) struct vmmdev_hgcm_function_parameter info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 896)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 897) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 898)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 899) #define SHFL_CPARMS_SYMLINK (4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 900)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 901) #endif