18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: MIT */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * VirtualBox Shared Folders: host interface definition.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2006-2018 Oracle Corporation
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef SHFL_HOSTINTF_H
98c2ecf20Sopenharmony_ci#define SHFL_HOSTINTF_H
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include <linux/vbox_vmmdev_types.h>
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci/* The max in/out buffer size for a FN_READ or FN_WRITE call */
148c2ecf20Sopenharmony_ci#define SHFL_MAX_RW_COUNT           (16 * SZ_1M)
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci/*
178c2ecf20Sopenharmony_ci * Structures shared between guest and the service
188c2ecf20Sopenharmony_ci * can be relocated and use offsets to point to variable
198c2ecf20Sopenharmony_ci * length parts.
208c2ecf20Sopenharmony_ci *
218c2ecf20Sopenharmony_ci * Shared folders protocol works with handles.
228c2ecf20Sopenharmony_ci * Before doing any action on a file system object,
238c2ecf20Sopenharmony_ci * one have to obtain the object handle via a SHFL_FN_CREATE
248c2ecf20Sopenharmony_ci * request. A handle must be closed with SHFL_FN_CLOSE.
258c2ecf20Sopenharmony_ci */
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_cienum {
288c2ecf20Sopenharmony_ci	SHFL_FN_QUERY_MAPPINGS = 1,	/* Query mappings changes. */
298c2ecf20Sopenharmony_ci	SHFL_FN_QUERY_MAP_NAME = 2,	/* Query map name. */
308c2ecf20Sopenharmony_ci	SHFL_FN_CREATE = 3,		/* Open/create object. */
318c2ecf20Sopenharmony_ci	SHFL_FN_CLOSE = 4,		/* Close object handle. */
328c2ecf20Sopenharmony_ci	SHFL_FN_READ = 5,		/* Read object content. */
338c2ecf20Sopenharmony_ci	SHFL_FN_WRITE = 6,		/* Write new object content. */
348c2ecf20Sopenharmony_ci	SHFL_FN_LOCK = 7,		/* Lock/unlock a range in the object. */
358c2ecf20Sopenharmony_ci	SHFL_FN_LIST = 8,		/* List object content. */
368c2ecf20Sopenharmony_ci	SHFL_FN_INFORMATION = 9,	/* Query/set object information. */
378c2ecf20Sopenharmony_ci	/* Note function number 10 is not used! */
388c2ecf20Sopenharmony_ci	SHFL_FN_REMOVE = 11,		/* Remove object */
398c2ecf20Sopenharmony_ci	SHFL_FN_MAP_FOLDER_OLD = 12,	/* Map folder (legacy) */
408c2ecf20Sopenharmony_ci	SHFL_FN_UNMAP_FOLDER = 13,	/* Unmap folder */
418c2ecf20Sopenharmony_ci	SHFL_FN_RENAME = 14,		/* Rename object */
428c2ecf20Sopenharmony_ci	SHFL_FN_FLUSH = 15,		/* Flush file */
438c2ecf20Sopenharmony_ci	SHFL_FN_SET_UTF8 = 16,		/* Select UTF8 filename encoding */
448c2ecf20Sopenharmony_ci	SHFL_FN_MAP_FOLDER = 17,	/* Map folder */
458c2ecf20Sopenharmony_ci	SHFL_FN_READLINK = 18,		/* Read symlink dest (as of VBox 4.0) */
468c2ecf20Sopenharmony_ci	SHFL_FN_SYMLINK = 19,		/* Create symlink (as of VBox 4.0) */
478c2ecf20Sopenharmony_ci	SHFL_FN_SET_SYMLINKS = 20,	/* Ask host to show symlinks (4.0+) */
488c2ecf20Sopenharmony_ci};
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci/* Root handles for a mapping are of type u32, Root handles are unique. */
518c2ecf20Sopenharmony_ci#define SHFL_ROOT_NIL		UINT_MAX
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci/* Shared folders handle for an opened object are of type u64. */
548c2ecf20Sopenharmony_ci#define SHFL_HANDLE_NIL		ULLONG_MAX
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci/* Hardcoded maximum length (in chars) of a shared folder name. */
578c2ecf20Sopenharmony_ci#define SHFL_MAX_LEN         (256)
588c2ecf20Sopenharmony_ci/* Hardcoded maximum number of shared folder mapping available to the guest. */
598c2ecf20Sopenharmony_ci#define SHFL_MAX_MAPPINGS    (64)
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci/** Shared folder string buffer structure. */
628c2ecf20Sopenharmony_cistruct shfl_string {
638c2ecf20Sopenharmony_ci	/** Allocated size of the string member in bytes. */
648c2ecf20Sopenharmony_ci	u16 size;
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci	/** Length of string without trailing nul in bytes. */
678c2ecf20Sopenharmony_ci	u16 length;
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci	/** UTF-8 or UTF-16 string. Nul terminated. */
708c2ecf20Sopenharmony_ci	union {
718c2ecf20Sopenharmony_ci		u8 utf8[2];
728c2ecf20Sopenharmony_ci		u16 utf16[1];
738c2ecf20Sopenharmony_ci		u16 ucs2[1]; /* misnomer, use utf16. */
748c2ecf20Sopenharmony_ci	} string;
758c2ecf20Sopenharmony_ci};
768c2ecf20Sopenharmony_ciVMMDEV_ASSERT_SIZE(shfl_string, 6);
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci/* The size of shfl_string w/o the string part. */
798c2ecf20Sopenharmony_ci#define SHFLSTRING_HEADER_SIZE  4
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci/* Calculate size of the string. */
828c2ecf20Sopenharmony_cistatic inline u32 shfl_string_buf_size(const struct shfl_string *string)
838c2ecf20Sopenharmony_ci{
848c2ecf20Sopenharmony_ci	return string ? SHFLSTRING_HEADER_SIZE + string->size : 0;
858c2ecf20Sopenharmony_ci}
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci/* Set user id on execution (S_ISUID). */
888c2ecf20Sopenharmony_ci#define SHFL_UNIX_ISUID             0004000U
898c2ecf20Sopenharmony_ci/* Set group id on execution (S_ISGID). */
908c2ecf20Sopenharmony_ci#define SHFL_UNIX_ISGID             0002000U
918c2ecf20Sopenharmony_ci/* Sticky bit (S_ISVTX / S_ISTXT). */
928c2ecf20Sopenharmony_ci#define SHFL_UNIX_ISTXT             0001000U
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci/* Owner readable (S_IRUSR). */
958c2ecf20Sopenharmony_ci#define SHFL_UNIX_IRUSR             0000400U
968c2ecf20Sopenharmony_ci/* Owner writable (S_IWUSR). */
978c2ecf20Sopenharmony_ci#define SHFL_UNIX_IWUSR             0000200U
988c2ecf20Sopenharmony_ci/* Owner executable (S_IXUSR). */
998c2ecf20Sopenharmony_ci#define SHFL_UNIX_IXUSR             0000100U
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci/* Group readable (S_IRGRP). */
1028c2ecf20Sopenharmony_ci#define SHFL_UNIX_IRGRP             0000040U
1038c2ecf20Sopenharmony_ci/* Group writable (S_IWGRP). */
1048c2ecf20Sopenharmony_ci#define SHFL_UNIX_IWGRP             0000020U
1058c2ecf20Sopenharmony_ci/* Group executable (S_IXGRP). */
1068c2ecf20Sopenharmony_ci#define SHFL_UNIX_IXGRP             0000010U
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci/* Other readable (S_IROTH). */
1098c2ecf20Sopenharmony_ci#define SHFL_UNIX_IROTH             0000004U
1108c2ecf20Sopenharmony_ci/* Other writable (S_IWOTH). */
1118c2ecf20Sopenharmony_ci#define SHFL_UNIX_IWOTH             0000002U
1128c2ecf20Sopenharmony_ci/* Other executable (S_IXOTH). */
1138c2ecf20Sopenharmony_ci#define SHFL_UNIX_IXOTH             0000001U
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci/* Named pipe (fifo) (S_IFIFO). */
1168c2ecf20Sopenharmony_ci#define SHFL_TYPE_FIFO              0010000U
1178c2ecf20Sopenharmony_ci/* Character device (S_IFCHR). */
1188c2ecf20Sopenharmony_ci#define SHFL_TYPE_DEV_CHAR          0020000U
1198c2ecf20Sopenharmony_ci/* Directory (S_IFDIR). */
1208c2ecf20Sopenharmony_ci#define SHFL_TYPE_DIRECTORY         0040000U
1218c2ecf20Sopenharmony_ci/* Block device (S_IFBLK). */
1228c2ecf20Sopenharmony_ci#define SHFL_TYPE_DEV_BLOCK         0060000U
1238c2ecf20Sopenharmony_ci/* Regular file (S_IFREG). */
1248c2ecf20Sopenharmony_ci#define SHFL_TYPE_FILE              0100000U
1258c2ecf20Sopenharmony_ci/* Symbolic link (S_IFLNK). */
1268c2ecf20Sopenharmony_ci#define SHFL_TYPE_SYMLINK           0120000U
1278c2ecf20Sopenharmony_ci/* Socket (S_IFSOCK). */
1288c2ecf20Sopenharmony_ci#define SHFL_TYPE_SOCKET            0140000U
1298c2ecf20Sopenharmony_ci/* Whiteout (S_IFWHT). */
1308c2ecf20Sopenharmony_ci#define SHFL_TYPE_WHITEOUT          0160000U
1318c2ecf20Sopenharmony_ci/* Type mask (S_IFMT). */
1328c2ecf20Sopenharmony_ci#define SHFL_TYPE_MASK              0170000U
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci/* Checks the mode flags indicate a directory (S_ISDIR). */
1358c2ecf20Sopenharmony_ci#define SHFL_IS_DIRECTORY(m)   (((m) & SHFL_TYPE_MASK) == SHFL_TYPE_DIRECTORY)
1368c2ecf20Sopenharmony_ci/* Checks the mode flags indicate a symbolic link (S_ISLNK). */
1378c2ecf20Sopenharmony_ci#define SHFL_IS_SYMLINK(m)     (((m) & SHFL_TYPE_MASK) == SHFL_TYPE_SYMLINK)
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci/** The available additional information in a shfl_fsobjattr object. */
1408c2ecf20Sopenharmony_cienum shfl_fsobjattr_add {
1418c2ecf20Sopenharmony_ci	/** No additional information is available / requested. */
1428c2ecf20Sopenharmony_ci	SHFLFSOBJATTRADD_NOTHING = 1,
1438c2ecf20Sopenharmony_ci	/**
1448c2ecf20Sopenharmony_ci	 * The additional unix attributes (shfl_fsobjattr::u::unix_attr) are
1458c2ecf20Sopenharmony_ci	 *  available / requested.
1468c2ecf20Sopenharmony_ci	 */
1478c2ecf20Sopenharmony_ci	SHFLFSOBJATTRADD_UNIX,
1488c2ecf20Sopenharmony_ci	/**
1498c2ecf20Sopenharmony_ci	 * The additional extended attribute size (shfl_fsobjattr::u::size) is
1508c2ecf20Sopenharmony_ci	 *  available / requested.
1518c2ecf20Sopenharmony_ci	 */
1528c2ecf20Sopenharmony_ci	SHFLFSOBJATTRADD_EASIZE,
1538c2ecf20Sopenharmony_ci	/**
1548c2ecf20Sopenharmony_ci	 * The last valid item (inclusive).
1558c2ecf20Sopenharmony_ci	 * The valid range is SHFLFSOBJATTRADD_NOTHING thru
1568c2ecf20Sopenharmony_ci	 * SHFLFSOBJATTRADD_LAST.
1578c2ecf20Sopenharmony_ci	 */
1588c2ecf20Sopenharmony_ci	SHFLFSOBJATTRADD_LAST = SHFLFSOBJATTRADD_EASIZE,
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci	/** The usual 32-bit hack. */
1618c2ecf20Sopenharmony_ci	SHFLFSOBJATTRADD_32BIT_SIZE_HACK = 0x7fffffff
1628c2ecf20Sopenharmony_ci};
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ci/**
1658c2ecf20Sopenharmony_ci * Additional unix Attributes, these are available when
1668c2ecf20Sopenharmony_ci * shfl_fsobjattr.additional == SHFLFSOBJATTRADD_UNIX.
1678c2ecf20Sopenharmony_ci */
1688c2ecf20Sopenharmony_cistruct shfl_fsobjattr_unix {
1698c2ecf20Sopenharmony_ci	/**
1708c2ecf20Sopenharmony_ci	 * The user owning the filesystem object (st_uid).
1718c2ecf20Sopenharmony_ci	 * This field is ~0U if not supported.
1728c2ecf20Sopenharmony_ci	 */
1738c2ecf20Sopenharmony_ci	u32 uid;
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ci	/**
1768c2ecf20Sopenharmony_ci	 * The group the filesystem object is assigned (st_gid).
1778c2ecf20Sopenharmony_ci	 * This field is ~0U if not supported.
1788c2ecf20Sopenharmony_ci	 */
1798c2ecf20Sopenharmony_ci	u32 gid;
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_ci	/**
1828c2ecf20Sopenharmony_ci	 * Number of hard links to this filesystem object (st_nlink).
1838c2ecf20Sopenharmony_ci	 * This field is 1 if the filesystem doesn't support hardlinking or
1848c2ecf20Sopenharmony_ci	 * the information isn't available.
1858c2ecf20Sopenharmony_ci	 */
1868c2ecf20Sopenharmony_ci	u32 hardlinks;
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ci	/**
1898c2ecf20Sopenharmony_ci	 * The device number of the device which this filesystem object resides
1908c2ecf20Sopenharmony_ci	 * on (st_dev). This field is 0 if this information is not available.
1918c2ecf20Sopenharmony_ci	 */
1928c2ecf20Sopenharmony_ci	u32 inode_id_device;
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ci	/**
1958c2ecf20Sopenharmony_ci	 * The unique identifier (within the filesystem) of this filesystem
1968c2ecf20Sopenharmony_ci	 * object (st_ino). Together with inode_id_device, this field can be
1978c2ecf20Sopenharmony_ci	 * used as a OS wide unique id, when both their values are not 0.
1988c2ecf20Sopenharmony_ci	 * This field is 0 if the information is not available.
1998c2ecf20Sopenharmony_ci	 */
2008c2ecf20Sopenharmony_ci	u64 inode_id;
2018c2ecf20Sopenharmony_ci
2028c2ecf20Sopenharmony_ci	/**
2038c2ecf20Sopenharmony_ci	 * User flags (st_flags).
2048c2ecf20Sopenharmony_ci	 * This field is 0 if this information is not available.
2058c2ecf20Sopenharmony_ci	 */
2068c2ecf20Sopenharmony_ci	u32 flags;
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_ci	/**
2098c2ecf20Sopenharmony_ci	 * The current generation number (st_gen).
2108c2ecf20Sopenharmony_ci	 * This field is 0 if this information is not available.
2118c2ecf20Sopenharmony_ci	 */
2128c2ecf20Sopenharmony_ci	u32 generation_id;
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_ci	/**
2158c2ecf20Sopenharmony_ci	 * The device number of a char. or block device type object (st_rdev).
2168c2ecf20Sopenharmony_ci	 * This field is 0 if the file isn't a char. or block device or when
2178c2ecf20Sopenharmony_ci	 * the OS doesn't use the major+minor device idenfication scheme.
2188c2ecf20Sopenharmony_ci	 */
2198c2ecf20Sopenharmony_ci	u32 device;
2208c2ecf20Sopenharmony_ci} __packed;
2218c2ecf20Sopenharmony_ci
2228c2ecf20Sopenharmony_ci/** Extended attribute size. */
2238c2ecf20Sopenharmony_cistruct shfl_fsobjattr_easize {
2248c2ecf20Sopenharmony_ci	/** Size of EAs. */
2258c2ecf20Sopenharmony_ci	s64 cb;
2268c2ecf20Sopenharmony_ci} __packed;
2278c2ecf20Sopenharmony_ci
2288c2ecf20Sopenharmony_ci/** Shared folder filesystem object attributes. */
2298c2ecf20Sopenharmony_cistruct shfl_fsobjattr {
2308c2ecf20Sopenharmony_ci	/** Mode flags (st_mode). SHFL_UNIX_*, SHFL_TYPE_*, and SHFL_DOS_*. */
2318c2ecf20Sopenharmony_ci	u32 mode;
2328c2ecf20Sopenharmony_ci
2338c2ecf20Sopenharmony_ci	/** The additional attributes available. */
2348c2ecf20Sopenharmony_ci	enum shfl_fsobjattr_add additional;
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci	/**
2378c2ecf20Sopenharmony_ci	 * Additional attributes.
2388c2ecf20Sopenharmony_ci	 *
2398c2ecf20Sopenharmony_ci	 * Unless explicitly specified to an API, the API can provide additional
2408c2ecf20Sopenharmony_ci	 * data as it is provided by the underlying OS.
2418c2ecf20Sopenharmony_ci	 */
2428c2ecf20Sopenharmony_ci	union {
2438c2ecf20Sopenharmony_ci		struct shfl_fsobjattr_unix unix_attr;
2448c2ecf20Sopenharmony_ci		struct shfl_fsobjattr_easize size;
2458c2ecf20Sopenharmony_ci	} __packed u;
2468c2ecf20Sopenharmony_ci} __packed;
2478c2ecf20Sopenharmony_ciVMMDEV_ASSERT_SIZE(shfl_fsobjattr, 44);
2488c2ecf20Sopenharmony_ci
2498c2ecf20Sopenharmony_cistruct shfl_timespec {
2508c2ecf20Sopenharmony_ci	s64 ns_relative_to_unix_epoch;
2518c2ecf20Sopenharmony_ci};
2528c2ecf20Sopenharmony_ci
2538c2ecf20Sopenharmony_ci/** Filesystem object information structure. */
2548c2ecf20Sopenharmony_cistruct shfl_fsobjinfo {
2558c2ecf20Sopenharmony_ci	/**
2568c2ecf20Sopenharmony_ci	 * Logical size (st_size).
2578c2ecf20Sopenharmony_ci	 * For normal files this is the size of the file.
2588c2ecf20Sopenharmony_ci	 * For symbolic links, this is the length of the path name contained
2598c2ecf20Sopenharmony_ci	 * in the symbolic link.
2608c2ecf20Sopenharmony_ci	 * For other objects this fields needs to be specified.
2618c2ecf20Sopenharmony_ci	 */
2628c2ecf20Sopenharmony_ci	s64 size;
2638c2ecf20Sopenharmony_ci
2648c2ecf20Sopenharmony_ci	/** Disk allocation size (st_blocks * DEV_BSIZE). */
2658c2ecf20Sopenharmony_ci	s64 allocated;
2668c2ecf20Sopenharmony_ci
2678c2ecf20Sopenharmony_ci	/** Time of last access (st_atime). */
2688c2ecf20Sopenharmony_ci	struct shfl_timespec access_time;
2698c2ecf20Sopenharmony_ci
2708c2ecf20Sopenharmony_ci	/** Time of last data modification (st_mtime). */
2718c2ecf20Sopenharmony_ci	struct shfl_timespec modification_time;
2728c2ecf20Sopenharmony_ci
2738c2ecf20Sopenharmony_ci	/**
2748c2ecf20Sopenharmony_ci	 * Time of last status change (st_ctime).
2758c2ecf20Sopenharmony_ci	 * If not available this is set to modification_time.
2768c2ecf20Sopenharmony_ci	 */
2778c2ecf20Sopenharmony_ci	struct shfl_timespec change_time;
2788c2ecf20Sopenharmony_ci
2798c2ecf20Sopenharmony_ci	/**
2808c2ecf20Sopenharmony_ci	 * Time of file birth (st_birthtime).
2818c2ecf20Sopenharmony_ci	 * If not available this is set to change_time.
2828c2ecf20Sopenharmony_ci	 */
2838c2ecf20Sopenharmony_ci	struct shfl_timespec birth_time;
2848c2ecf20Sopenharmony_ci
2858c2ecf20Sopenharmony_ci	/** Attributes. */
2868c2ecf20Sopenharmony_ci	struct shfl_fsobjattr attr;
2878c2ecf20Sopenharmony_ci
2888c2ecf20Sopenharmony_ci} __packed;
2898c2ecf20Sopenharmony_ciVMMDEV_ASSERT_SIZE(shfl_fsobjinfo, 92);
2908c2ecf20Sopenharmony_ci
2918c2ecf20Sopenharmony_ci/**
2928c2ecf20Sopenharmony_ci * result of an open/create request.
2938c2ecf20Sopenharmony_ci * Along with handle value the result code
2948c2ecf20Sopenharmony_ci * identifies what has happened while
2958c2ecf20Sopenharmony_ci * trying to open the object.
2968c2ecf20Sopenharmony_ci */
2978c2ecf20Sopenharmony_cienum shfl_create_result {
2988c2ecf20Sopenharmony_ci	SHFL_NO_RESULT,
2998c2ecf20Sopenharmony_ci	/** Specified path does not exist. */
3008c2ecf20Sopenharmony_ci	SHFL_PATH_NOT_FOUND,
3018c2ecf20Sopenharmony_ci	/** Path to file exists, but the last component does not. */
3028c2ecf20Sopenharmony_ci	SHFL_FILE_NOT_FOUND,
3038c2ecf20Sopenharmony_ci	/** File already exists and either has been opened or not. */
3048c2ecf20Sopenharmony_ci	SHFL_FILE_EXISTS,
3058c2ecf20Sopenharmony_ci	/** New file was created. */
3068c2ecf20Sopenharmony_ci	SHFL_FILE_CREATED,
3078c2ecf20Sopenharmony_ci	/** Existing file was replaced or overwritten. */
3088c2ecf20Sopenharmony_ci	SHFL_FILE_REPLACED
3098c2ecf20Sopenharmony_ci};
3108c2ecf20Sopenharmony_ci
3118c2ecf20Sopenharmony_ci/* No flags. Initialization value. */
3128c2ecf20Sopenharmony_ci#define SHFL_CF_NONE                  (0x00000000)
3138c2ecf20Sopenharmony_ci
3148c2ecf20Sopenharmony_ci/*
3158c2ecf20Sopenharmony_ci * Only lookup the object, do not return a handle. When this is set all other
3168c2ecf20Sopenharmony_ci * flags are ignored.
3178c2ecf20Sopenharmony_ci */
3188c2ecf20Sopenharmony_ci#define SHFL_CF_LOOKUP                (0x00000001)
3198c2ecf20Sopenharmony_ci
3208c2ecf20Sopenharmony_ci/*
3218c2ecf20Sopenharmony_ci * Open parent directory of specified object.
3228c2ecf20Sopenharmony_ci * Useful for the corresponding Windows FSD flag
3238c2ecf20Sopenharmony_ci * and for opening paths like \\dir\\*.* to search the 'dir'.
3248c2ecf20Sopenharmony_ci */
3258c2ecf20Sopenharmony_ci#define SHFL_CF_OPEN_TARGET_DIRECTORY (0x00000002)
3268c2ecf20Sopenharmony_ci
3278c2ecf20Sopenharmony_ci/* Create/open a directory. */
3288c2ecf20Sopenharmony_ci#define SHFL_CF_DIRECTORY             (0x00000004)
3298c2ecf20Sopenharmony_ci
3308c2ecf20Sopenharmony_ci/*
3318c2ecf20Sopenharmony_ci *  Open/create action to do if object exists
3328c2ecf20Sopenharmony_ci *  and if the object does not exists.
3338c2ecf20Sopenharmony_ci *  REPLACE file means atomically DELETE and CREATE.
3348c2ecf20Sopenharmony_ci *  OVERWRITE file means truncating the file to 0 and
3358c2ecf20Sopenharmony_ci *  setting new size.
3368c2ecf20Sopenharmony_ci *  When opening an existing directory REPLACE and OVERWRITE
3378c2ecf20Sopenharmony_ci *  actions are considered invalid, and cause returning
3388c2ecf20Sopenharmony_ci *  FILE_EXISTS with NIL handle.
3398c2ecf20Sopenharmony_ci */
3408c2ecf20Sopenharmony_ci#define SHFL_CF_ACT_MASK_IF_EXISTS      (0x000000f0)
3418c2ecf20Sopenharmony_ci#define SHFL_CF_ACT_MASK_IF_NEW         (0x00000f00)
3428c2ecf20Sopenharmony_ci
3438c2ecf20Sopenharmony_ci/* What to do if object exists. */
3448c2ecf20Sopenharmony_ci#define SHFL_CF_ACT_OPEN_IF_EXISTS      (0x00000000)
3458c2ecf20Sopenharmony_ci#define SHFL_CF_ACT_FAIL_IF_EXISTS      (0x00000010)
3468c2ecf20Sopenharmony_ci#define SHFL_CF_ACT_REPLACE_IF_EXISTS   (0x00000020)
3478c2ecf20Sopenharmony_ci#define SHFL_CF_ACT_OVERWRITE_IF_EXISTS (0x00000030)
3488c2ecf20Sopenharmony_ci
3498c2ecf20Sopenharmony_ci/* What to do if object does not exist. */
3508c2ecf20Sopenharmony_ci#define SHFL_CF_ACT_CREATE_IF_NEW       (0x00000000)
3518c2ecf20Sopenharmony_ci#define SHFL_CF_ACT_FAIL_IF_NEW         (0x00000100)
3528c2ecf20Sopenharmony_ci
3538c2ecf20Sopenharmony_ci/* Read/write requested access for the object. */
3548c2ecf20Sopenharmony_ci#define SHFL_CF_ACCESS_MASK_RW          (0x00003000)
3558c2ecf20Sopenharmony_ci
3568c2ecf20Sopenharmony_ci/* No access requested. */
3578c2ecf20Sopenharmony_ci#define SHFL_CF_ACCESS_NONE             (0x00000000)
3588c2ecf20Sopenharmony_ci/* Read access requested. */
3598c2ecf20Sopenharmony_ci#define SHFL_CF_ACCESS_READ             (0x00001000)
3608c2ecf20Sopenharmony_ci/* Write access requested. */
3618c2ecf20Sopenharmony_ci#define SHFL_CF_ACCESS_WRITE            (0x00002000)
3628c2ecf20Sopenharmony_ci/* Read/Write access requested. */
3638c2ecf20Sopenharmony_ci#define SHFL_CF_ACCESS_READWRITE	(0x00003000)
3648c2ecf20Sopenharmony_ci
3658c2ecf20Sopenharmony_ci/* Requested share access for the object. */
3668c2ecf20Sopenharmony_ci#define SHFL_CF_ACCESS_MASK_DENY        (0x0000c000)
3678c2ecf20Sopenharmony_ci
3688c2ecf20Sopenharmony_ci/* Allow any access. */
3698c2ecf20Sopenharmony_ci#define SHFL_CF_ACCESS_DENYNONE         (0x00000000)
3708c2ecf20Sopenharmony_ci/* Do not allow read. */
3718c2ecf20Sopenharmony_ci#define SHFL_CF_ACCESS_DENYREAD         (0x00004000)
3728c2ecf20Sopenharmony_ci/* Do not allow write. */
3738c2ecf20Sopenharmony_ci#define SHFL_CF_ACCESS_DENYWRITE        (0x00008000)
3748c2ecf20Sopenharmony_ci/* Do not allow access. */
3758c2ecf20Sopenharmony_ci#define SHFL_CF_ACCESS_DENYALL          (0x0000c000)
3768c2ecf20Sopenharmony_ci
3778c2ecf20Sopenharmony_ci/* Requested access to attributes of the object. */
3788c2ecf20Sopenharmony_ci#define SHFL_CF_ACCESS_MASK_ATTR        (0x00030000)
3798c2ecf20Sopenharmony_ci
3808c2ecf20Sopenharmony_ci/* No access requested. */
3818c2ecf20Sopenharmony_ci#define SHFL_CF_ACCESS_ATTR_NONE        (0x00000000)
3828c2ecf20Sopenharmony_ci/* Read access requested. */
3838c2ecf20Sopenharmony_ci#define SHFL_CF_ACCESS_ATTR_READ        (0x00010000)
3848c2ecf20Sopenharmony_ci/* Write access requested. */
3858c2ecf20Sopenharmony_ci#define SHFL_CF_ACCESS_ATTR_WRITE       (0x00020000)
3868c2ecf20Sopenharmony_ci/* Read/Write access requested. */
3878c2ecf20Sopenharmony_ci#define SHFL_CF_ACCESS_ATTR_READWRITE   (0x00030000)
3888c2ecf20Sopenharmony_ci
3898c2ecf20Sopenharmony_ci/*
3908c2ecf20Sopenharmony_ci * The file is opened in append mode.
3918c2ecf20Sopenharmony_ci * Ignored if SHFL_CF_ACCESS_WRITE is not set.
3928c2ecf20Sopenharmony_ci */
3938c2ecf20Sopenharmony_ci#define SHFL_CF_ACCESS_APPEND           (0x00040000)
3948c2ecf20Sopenharmony_ci
3958c2ecf20Sopenharmony_ci/** Create parameters buffer struct for SHFL_FN_CREATE call */
3968c2ecf20Sopenharmony_cistruct shfl_createparms {
3978c2ecf20Sopenharmony_ci	/** Returned handle of opened object. */
3988c2ecf20Sopenharmony_ci	u64 handle;
3998c2ecf20Sopenharmony_ci
4008c2ecf20Sopenharmony_ci	/** Returned result of the operation */
4018c2ecf20Sopenharmony_ci	enum shfl_create_result result;
4028c2ecf20Sopenharmony_ci
4038c2ecf20Sopenharmony_ci	/** SHFL_CF_* */
4048c2ecf20Sopenharmony_ci	u32 create_flags;
4058c2ecf20Sopenharmony_ci
4068c2ecf20Sopenharmony_ci	/**
4078c2ecf20Sopenharmony_ci	 * Attributes of object to create and
4088c2ecf20Sopenharmony_ci	 * returned actual attributes of opened/created object.
4098c2ecf20Sopenharmony_ci	 */
4108c2ecf20Sopenharmony_ci	struct shfl_fsobjinfo info;
4118c2ecf20Sopenharmony_ci} __packed;
4128c2ecf20Sopenharmony_ci
4138c2ecf20Sopenharmony_ci/** Shared Folder directory information */
4148c2ecf20Sopenharmony_cistruct shfl_dirinfo {
4158c2ecf20Sopenharmony_ci	/** Full information about the object. */
4168c2ecf20Sopenharmony_ci	struct shfl_fsobjinfo info;
4178c2ecf20Sopenharmony_ci	/**
4188c2ecf20Sopenharmony_ci	 * The length of the short field (number of UTF16 chars).
4198c2ecf20Sopenharmony_ci	 * It is 16-bit for reasons of alignment.
4208c2ecf20Sopenharmony_ci	 */
4218c2ecf20Sopenharmony_ci	u16 short_name_len;
4228c2ecf20Sopenharmony_ci	/**
4238c2ecf20Sopenharmony_ci	 * The short name for 8.3 compatibility.
4248c2ecf20Sopenharmony_ci	 * Empty string if not available.
4258c2ecf20Sopenharmony_ci	 */
4268c2ecf20Sopenharmony_ci	u16 short_name[14];
4278c2ecf20Sopenharmony_ci	struct shfl_string name;
4288c2ecf20Sopenharmony_ci};
4298c2ecf20Sopenharmony_ci
4308c2ecf20Sopenharmony_ci/** Shared folder filesystem properties. */
4318c2ecf20Sopenharmony_cistruct shfl_fsproperties {
4328c2ecf20Sopenharmony_ci	/**
4338c2ecf20Sopenharmony_ci	 * The maximum size of a filesystem object name.
4348c2ecf20Sopenharmony_ci	 * This does not include the '\\0'.
4358c2ecf20Sopenharmony_ci	 */
4368c2ecf20Sopenharmony_ci	u32 max_component_len;
4378c2ecf20Sopenharmony_ci
4388c2ecf20Sopenharmony_ci	/**
4398c2ecf20Sopenharmony_ci	 * True if the filesystem is remote.
4408c2ecf20Sopenharmony_ci	 * False if the filesystem is local.
4418c2ecf20Sopenharmony_ci	 */
4428c2ecf20Sopenharmony_ci	bool remote;
4438c2ecf20Sopenharmony_ci
4448c2ecf20Sopenharmony_ci	/**
4458c2ecf20Sopenharmony_ci	 * True if the filesystem is case sensitive.
4468c2ecf20Sopenharmony_ci	 * False if the filesystem is case insensitive.
4478c2ecf20Sopenharmony_ci	 */
4488c2ecf20Sopenharmony_ci	bool case_sensitive;
4498c2ecf20Sopenharmony_ci
4508c2ecf20Sopenharmony_ci	/**
4518c2ecf20Sopenharmony_ci	 * True if the filesystem is mounted read only.
4528c2ecf20Sopenharmony_ci	 * False if the filesystem is mounted read write.
4538c2ecf20Sopenharmony_ci	 */
4548c2ecf20Sopenharmony_ci	bool read_only;
4558c2ecf20Sopenharmony_ci
4568c2ecf20Sopenharmony_ci	/**
4578c2ecf20Sopenharmony_ci	 * True if the filesystem can encode unicode object names.
4588c2ecf20Sopenharmony_ci	 * False if it can't.
4598c2ecf20Sopenharmony_ci	 */
4608c2ecf20Sopenharmony_ci	bool supports_unicode;
4618c2ecf20Sopenharmony_ci
4628c2ecf20Sopenharmony_ci	/**
4638c2ecf20Sopenharmony_ci	 * True if the filesystem is compresses.
4648c2ecf20Sopenharmony_ci	 * False if it isn't or we don't know.
4658c2ecf20Sopenharmony_ci	 */
4668c2ecf20Sopenharmony_ci	bool compressed;
4678c2ecf20Sopenharmony_ci
4688c2ecf20Sopenharmony_ci	/**
4698c2ecf20Sopenharmony_ci	 * True if the filesystem compresses of individual files.
4708c2ecf20Sopenharmony_ci	 * False if it doesn't or we don't know.
4718c2ecf20Sopenharmony_ci	 */
4728c2ecf20Sopenharmony_ci	bool file_compression;
4738c2ecf20Sopenharmony_ci};
4748c2ecf20Sopenharmony_ciVMMDEV_ASSERT_SIZE(shfl_fsproperties, 12);
4758c2ecf20Sopenharmony_ci
4768c2ecf20Sopenharmony_cistruct shfl_volinfo {
4778c2ecf20Sopenharmony_ci	s64 total_allocation_bytes;
4788c2ecf20Sopenharmony_ci	s64 available_allocation_bytes;
4798c2ecf20Sopenharmony_ci	u32 bytes_per_allocation_unit;
4808c2ecf20Sopenharmony_ci	u32 bytes_per_sector;
4818c2ecf20Sopenharmony_ci	u32 serial;
4828c2ecf20Sopenharmony_ci	struct shfl_fsproperties properties;
4838c2ecf20Sopenharmony_ci};
4848c2ecf20Sopenharmony_ci
4858c2ecf20Sopenharmony_ci
4868c2ecf20Sopenharmony_ci/** SHFL_FN_MAP_FOLDER Parameters structure. */
4878c2ecf20Sopenharmony_cistruct shfl_map_folder {
4888c2ecf20Sopenharmony_ci	/**
4898c2ecf20Sopenharmony_ci	 * pointer, in:
4908c2ecf20Sopenharmony_ci	 * Points to struct shfl_string buffer.
4918c2ecf20Sopenharmony_ci	 */
4928c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter path;
4938c2ecf20Sopenharmony_ci
4948c2ecf20Sopenharmony_ci	/**
4958c2ecf20Sopenharmony_ci	 * pointer, out: SHFLROOT (u32)
4968c2ecf20Sopenharmony_ci	 * Root handle of the mapping which name is queried.
4978c2ecf20Sopenharmony_ci	 */
4988c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter root;
4998c2ecf20Sopenharmony_ci
5008c2ecf20Sopenharmony_ci	/**
5018c2ecf20Sopenharmony_ci	 * pointer, in: UTF16
5028c2ecf20Sopenharmony_ci	 * Path delimiter
5038c2ecf20Sopenharmony_ci	 */
5048c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter delimiter;
5058c2ecf20Sopenharmony_ci
5068c2ecf20Sopenharmony_ci	/**
5078c2ecf20Sopenharmony_ci	 * pointer, in: SHFLROOT (u32)
5088c2ecf20Sopenharmony_ci	 * Case senstive flag
5098c2ecf20Sopenharmony_ci	 */
5108c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter case_sensitive;
5118c2ecf20Sopenharmony_ci
5128c2ecf20Sopenharmony_ci};
5138c2ecf20Sopenharmony_ci
5148c2ecf20Sopenharmony_ci/* Number of parameters */
5158c2ecf20Sopenharmony_ci#define SHFL_CPARMS_MAP_FOLDER (4)
5168c2ecf20Sopenharmony_ci
5178c2ecf20Sopenharmony_ci
5188c2ecf20Sopenharmony_ci/** SHFL_FN_UNMAP_FOLDER Parameters structure. */
5198c2ecf20Sopenharmony_cistruct shfl_unmap_folder {
5208c2ecf20Sopenharmony_ci	/**
5218c2ecf20Sopenharmony_ci	 * pointer, in: SHFLROOT (u32)
5228c2ecf20Sopenharmony_ci	 * Root handle of the mapping which name is queried.
5238c2ecf20Sopenharmony_ci	 */
5248c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter root;
5258c2ecf20Sopenharmony_ci
5268c2ecf20Sopenharmony_ci};
5278c2ecf20Sopenharmony_ci
5288c2ecf20Sopenharmony_ci/* Number of parameters */
5298c2ecf20Sopenharmony_ci#define SHFL_CPARMS_UNMAP_FOLDER (1)
5308c2ecf20Sopenharmony_ci
5318c2ecf20Sopenharmony_ci
5328c2ecf20Sopenharmony_ci/** SHFL_FN_CREATE Parameters structure. */
5338c2ecf20Sopenharmony_cistruct shfl_create {
5348c2ecf20Sopenharmony_ci	/**
5358c2ecf20Sopenharmony_ci	 * pointer, in: SHFLROOT (u32)
5368c2ecf20Sopenharmony_ci	 * Root handle of the mapping which name is queried.
5378c2ecf20Sopenharmony_ci	 */
5388c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter root;
5398c2ecf20Sopenharmony_ci
5408c2ecf20Sopenharmony_ci	/**
5418c2ecf20Sopenharmony_ci	 * pointer, in:
5428c2ecf20Sopenharmony_ci	 * Points to struct shfl_string buffer.
5438c2ecf20Sopenharmony_ci	 */
5448c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter path;
5458c2ecf20Sopenharmony_ci
5468c2ecf20Sopenharmony_ci	/**
5478c2ecf20Sopenharmony_ci	 * pointer, in/out:
5488c2ecf20Sopenharmony_ci	 * Points to struct shfl_createparms buffer.
5498c2ecf20Sopenharmony_ci	 */
5508c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter parms;
5518c2ecf20Sopenharmony_ci
5528c2ecf20Sopenharmony_ci};
5538c2ecf20Sopenharmony_ci
5548c2ecf20Sopenharmony_ci/* Number of parameters */
5558c2ecf20Sopenharmony_ci#define SHFL_CPARMS_CREATE (3)
5568c2ecf20Sopenharmony_ci
5578c2ecf20Sopenharmony_ci
5588c2ecf20Sopenharmony_ci/** SHFL_FN_CLOSE Parameters structure. */
5598c2ecf20Sopenharmony_cistruct shfl_close {
5608c2ecf20Sopenharmony_ci	/**
5618c2ecf20Sopenharmony_ci	 * pointer, in: SHFLROOT (u32)
5628c2ecf20Sopenharmony_ci	 * Root handle of the mapping which name is queried.
5638c2ecf20Sopenharmony_ci	 */
5648c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter root;
5658c2ecf20Sopenharmony_ci
5668c2ecf20Sopenharmony_ci	/**
5678c2ecf20Sopenharmony_ci	 * value64, in:
5688c2ecf20Sopenharmony_ci	 * SHFLHANDLE (u64) of object to close.
5698c2ecf20Sopenharmony_ci	 */
5708c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter handle;
5718c2ecf20Sopenharmony_ci
5728c2ecf20Sopenharmony_ci};
5738c2ecf20Sopenharmony_ci
5748c2ecf20Sopenharmony_ci/* Number of parameters */
5758c2ecf20Sopenharmony_ci#define SHFL_CPARMS_CLOSE (2)
5768c2ecf20Sopenharmony_ci
5778c2ecf20Sopenharmony_ci
5788c2ecf20Sopenharmony_ci/** SHFL_FN_READ Parameters structure. */
5798c2ecf20Sopenharmony_cistruct shfl_read {
5808c2ecf20Sopenharmony_ci	/**
5818c2ecf20Sopenharmony_ci	 * pointer, in: SHFLROOT (u32)
5828c2ecf20Sopenharmony_ci	 * Root handle of the mapping which name is queried.
5838c2ecf20Sopenharmony_ci	 */
5848c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter root;
5858c2ecf20Sopenharmony_ci
5868c2ecf20Sopenharmony_ci	/**
5878c2ecf20Sopenharmony_ci	 * value64, in:
5888c2ecf20Sopenharmony_ci	 * SHFLHANDLE (u64) of object to read from.
5898c2ecf20Sopenharmony_ci	 */
5908c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter handle;
5918c2ecf20Sopenharmony_ci
5928c2ecf20Sopenharmony_ci	/**
5938c2ecf20Sopenharmony_ci	 * value64, in:
5948c2ecf20Sopenharmony_ci	 * Offset to read from.
5958c2ecf20Sopenharmony_ci	 */
5968c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter offset;
5978c2ecf20Sopenharmony_ci
5988c2ecf20Sopenharmony_ci	/**
5998c2ecf20Sopenharmony_ci	 * value64, in/out:
6008c2ecf20Sopenharmony_ci	 * Bytes to read/How many were read.
6018c2ecf20Sopenharmony_ci	 */
6028c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter cb;
6038c2ecf20Sopenharmony_ci
6048c2ecf20Sopenharmony_ci	/**
6058c2ecf20Sopenharmony_ci	 * pointer, out:
6068c2ecf20Sopenharmony_ci	 * Buffer to place data to.
6078c2ecf20Sopenharmony_ci	 */
6088c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter buffer;
6098c2ecf20Sopenharmony_ci
6108c2ecf20Sopenharmony_ci};
6118c2ecf20Sopenharmony_ci
6128c2ecf20Sopenharmony_ci/* Number of parameters */
6138c2ecf20Sopenharmony_ci#define SHFL_CPARMS_READ (5)
6148c2ecf20Sopenharmony_ci
6158c2ecf20Sopenharmony_ci
6168c2ecf20Sopenharmony_ci/** SHFL_FN_WRITE Parameters structure. */
6178c2ecf20Sopenharmony_cistruct shfl_write {
6188c2ecf20Sopenharmony_ci	/**
6198c2ecf20Sopenharmony_ci	 * pointer, in: SHFLROOT (u32)
6208c2ecf20Sopenharmony_ci	 * Root handle of the mapping which name is queried.
6218c2ecf20Sopenharmony_ci	 */
6228c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter root;
6238c2ecf20Sopenharmony_ci
6248c2ecf20Sopenharmony_ci	/**
6258c2ecf20Sopenharmony_ci	 * value64, in:
6268c2ecf20Sopenharmony_ci	 * SHFLHANDLE (u64) of object to write to.
6278c2ecf20Sopenharmony_ci	 */
6288c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter handle;
6298c2ecf20Sopenharmony_ci
6308c2ecf20Sopenharmony_ci	/**
6318c2ecf20Sopenharmony_ci	 * value64, in:
6328c2ecf20Sopenharmony_ci	 * Offset to write to.
6338c2ecf20Sopenharmony_ci	 */
6348c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter offset;
6358c2ecf20Sopenharmony_ci
6368c2ecf20Sopenharmony_ci	/**
6378c2ecf20Sopenharmony_ci	 * value64, in/out:
6388c2ecf20Sopenharmony_ci	 * Bytes to write/How many were written.
6398c2ecf20Sopenharmony_ci	 */
6408c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter cb;
6418c2ecf20Sopenharmony_ci
6428c2ecf20Sopenharmony_ci	/**
6438c2ecf20Sopenharmony_ci	 * pointer, in:
6448c2ecf20Sopenharmony_ci	 * Data to write.
6458c2ecf20Sopenharmony_ci	 */
6468c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter buffer;
6478c2ecf20Sopenharmony_ci
6488c2ecf20Sopenharmony_ci};
6498c2ecf20Sopenharmony_ci
6508c2ecf20Sopenharmony_ci/* Number of parameters */
6518c2ecf20Sopenharmony_ci#define SHFL_CPARMS_WRITE (5)
6528c2ecf20Sopenharmony_ci
6538c2ecf20Sopenharmony_ci
6548c2ecf20Sopenharmony_ci/*
6558c2ecf20Sopenharmony_ci * SHFL_FN_LIST
6568c2ecf20Sopenharmony_ci * Listing information includes variable length RTDIRENTRY[EX] structures.
6578c2ecf20Sopenharmony_ci */
6588c2ecf20Sopenharmony_ci
6598c2ecf20Sopenharmony_ci#define SHFL_LIST_NONE			0
6608c2ecf20Sopenharmony_ci#define SHFL_LIST_RETURN_ONE		1
6618c2ecf20Sopenharmony_ci
6628c2ecf20Sopenharmony_ci/** SHFL_FN_LIST Parameters structure. */
6638c2ecf20Sopenharmony_cistruct shfl_list {
6648c2ecf20Sopenharmony_ci	/**
6658c2ecf20Sopenharmony_ci	 * pointer, in: SHFLROOT (u32)
6668c2ecf20Sopenharmony_ci	 * Root handle of the mapping which name is queried.
6678c2ecf20Sopenharmony_ci	 */
6688c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter root;
6698c2ecf20Sopenharmony_ci
6708c2ecf20Sopenharmony_ci	/**
6718c2ecf20Sopenharmony_ci	 * value64, in:
6728c2ecf20Sopenharmony_ci	 * SHFLHANDLE (u64) of object to be listed.
6738c2ecf20Sopenharmony_ci	 */
6748c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter handle;
6758c2ecf20Sopenharmony_ci
6768c2ecf20Sopenharmony_ci	/**
6778c2ecf20Sopenharmony_ci	 * value32, in:
6788c2ecf20Sopenharmony_ci	 * List flags SHFL_LIST_*.
6798c2ecf20Sopenharmony_ci	 */
6808c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter flags;
6818c2ecf20Sopenharmony_ci
6828c2ecf20Sopenharmony_ci	/**
6838c2ecf20Sopenharmony_ci	 * value32, in/out:
6848c2ecf20Sopenharmony_ci	 * Bytes to be used for listing information/How many bytes were used.
6858c2ecf20Sopenharmony_ci	 */
6868c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter cb;
6878c2ecf20Sopenharmony_ci
6888c2ecf20Sopenharmony_ci	/**
6898c2ecf20Sopenharmony_ci	 * pointer, in/optional
6908c2ecf20Sopenharmony_ci	 * Points to struct shfl_string buffer that specifies a search path.
6918c2ecf20Sopenharmony_ci	 */
6928c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter path;
6938c2ecf20Sopenharmony_ci
6948c2ecf20Sopenharmony_ci	/**
6958c2ecf20Sopenharmony_ci	 * pointer, out:
6968c2ecf20Sopenharmony_ci	 * Buffer to place listing information to. (struct shfl_dirinfo)
6978c2ecf20Sopenharmony_ci	 */
6988c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter buffer;
6998c2ecf20Sopenharmony_ci
7008c2ecf20Sopenharmony_ci	/**
7018c2ecf20Sopenharmony_ci	 * value32, in/out:
7028c2ecf20Sopenharmony_ci	 * Indicates a key where the listing must be resumed.
7038c2ecf20Sopenharmony_ci	 * in: 0 means start from begin of object.
7048c2ecf20Sopenharmony_ci	 * out: 0 means listing completed.
7058c2ecf20Sopenharmony_ci	 */
7068c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter resume_point;
7078c2ecf20Sopenharmony_ci
7088c2ecf20Sopenharmony_ci	/**
7098c2ecf20Sopenharmony_ci	 * pointer, out:
7108c2ecf20Sopenharmony_ci	 * Number of files returned
7118c2ecf20Sopenharmony_ci	 */
7128c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter file_count;
7138c2ecf20Sopenharmony_ci};
7148c2ecf20Sopenharmony_ci
7158c2ecf20Sopenharmony_ci/* Number of parameters */
7168c2ecf20Sopenharmony_ci#define SHFL_CPARMS_LIST (8)
7178c2ecf20Sopenharmony_ci
7188c2ecf20Sopenharmony_ci
7198c2ecf20Sopenharmony_ci/** SHFL_FN_READLINK Parameters structure. */
7208c2ecf20Sopenharmony_cistruct shfl_readLink {
7218c2ecf20Sopenharmony_ci	/**
7228c2ecf20Sopenharmony_ci	 * pointer, in: SHFLROOT (u32)
7238c2ecf20Sopenharmony_ci	 * Root handle of the mapping which name is queried.
7248c2ecf20Sopenharmony_ci	 */
7258c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter root;
7268c2ecf20Sopenharmony_ci
7278c2ecf20Sopenharmony_ci	/**
7288c2ecf20Sopenharmony_ci	 * pointer, in:
7298c2ecf20Sopenharmony_ci	 * Points to struct shfl_string buffer.
7308c2ecf20Sopenharmony_ci	 */
7318c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter path;
7328c2ecf20Sopenharmony_ci
7338c2ecf20Sopenharmony_ci	/**
7348c2ecf20Sopenharmony_ci	 * pointer, out:
7358c2ecf20Sopenharmony_ci	 * Buffer to place data to.
7368c2ecf20Sopenharmony_ci	 */
7378c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter buffer;
7388c2ecf20Sopenharmony_ci
7398c2ecf20Sopenharmony_ci};
7408c2ecf20Sopenharmony_ci
7418c2ecf20Sopenharmony_ci/* Number of parameters */
7428c2ecf20Sopenharmony_ci#define SHFL_CPARMS_READLINK (3)
7438c2ecf20Sopenharmony_ci
7448c2ecf20Sopenharmony_ci
7458c2ecf20Sopenharmony_ci/* SHFL_FN_INFORMATION */
7468c2ecf20Sopenharmony_ci
7478c2ecf20Sopenharmony_ci/* Mask of Set/Get bit. */
7488c2ecf20Sopenharmony_ci#define SHFL_INFO_MODE_MASK    (0x1)
7498c2ecf20Sopenharmony_ci/* Get information */
7508c2ecf20Sopenharmony_ci#define SHFL_INFO_GET          (0x0)
7518c2ecf20Sopenharmony_ci/* Set information */
7528c2ecf20Sopenharmony_ci#define SHFL_INFO_SET          (0x1)
7538c2ecf20Sopenharmony_ci
7548c2ecf20Sopenharmony_ci/* Get name of the object. */
7558c2ecf20Sopenharmony_ci#define SHFL_INFO_NAME         (0x2)
7568c2ecf20Sopenharmony_ci/* Set size of object (extend/trucate); only applies to file objects */
7578c2ecf20Sopenharmony_ci#define SHFL_INFO_SIZE         (0x4)
7588c2ecf20Sopenharmony_ci/* Get/Set file object info. */
7598c2ecf20Sopenharmony_ci#define SHFL_INFO_FILE         (0x8)
7608c2ecf20Sopenharmony_ci/* Get volume information. */
7618c2ecf20Sopenharmony_ci#define SHFL_INFO_VOLUME       (0x10)
7628c2ecf20Sopenharmony_ci
7638c2ecf20Sopenharmony_ci/** SHFL_FN_INFORMATION Parameters structure. */
7648c2ecf20Sopenharmony_cistruct shfl_information {
7658c2ecf20Sopenharmony_ci	/**
7668c2ecf20Sopenharmony_ci	 * pointer, in: SHFLROOT (u32)
7678c2ecf20Sopenharmony_ci	 * Root handle of the mapping which name is queried.
7688c2ecf20Sopenharmony_ci	 */
7698c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter root;
7708c2ecf20Sopenharmony_ci
7718c2ecf20Sopenharmony_ci	/**
7728c2ecf20Sopenharmony_ci	 * value64, in:
7738c2ecf20Sopenharmony_ci	 * SHFLHANDLE (u64) of object to be listed.
7748c2ecf20Sopenharmony_ci	 */
7758c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter handle;
7768c2ecf20Sopenharmony_ci
7778c2ecf20Sopenharmony_ci	/**
7788c2ecf20Sopenharmony_ci	 * value32, in:
7798c2ecf20Sopenharmony_ci	 * SHFL_INFO_*
7808c2ecf20Sopenharmony_ci	 */
7818c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter flags;
7828c2ecf20Sopenharmony_ci
7838c2ecf20Sopenharmony_ci	/**
7848c2ecf20Sopenharmony_ci	 * value32, in/out:
7858c2ecf20Sopenharmony_ci	 * Bytes to be used for information/How many bytes were used.
7868c2ecf20Sopenharmony_ci	 */
7878c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter cb;
7888c2ecf20Sopenharmony_ci
7898c2ecf20Sopenharmony_ci	/**
7908c2ecf20Sopenharmony_ci	 * pointer, in/out:
7918c2ecf20Sopenharmony_ci	 * Information to be set/get (shfl_fsobjinfo or shfl_string). Do not
7928c2ecf20Sopenharmony_ci	 * forget to set the shfl_fsobjinfo::attr::additional for a get
7938c2ecf20Sopenharmony_ci	 * operation as well.
7948c2ecf20Sopenharmony_ci	 */
7958c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter info;
7968c2ecf20Sopenharmony_ci
7978c2ecf20Sopenharmony_ci};
7988c2ecf20Sopenharmony_ci
7998c2ecf20Sopenharmony_ci/* Number of parameters */
8008c2ecf20Sopenharmony_ci#define SHFL_CPARMS_INFORMATION (5)
8018c2ecf20Sopenharmony_ci
8028c2ecf20Sopenharmony_ci
8038c2ecf20Sopenharmony_ci/* SHFL_FN_REMOVE */
8048c2ecf20Sopenharmony_ci
8058c2ecf20Sopenharmony_ci#define SHFL_REMOVE_FILE        (0x1)
8068c2ecf20Sopenharmony_ci#define SHFL_REMOVE_DIR         (0x2)
8078c2ecf20Sopenharmony_ci#define SHFL_REMOVE_SYMLINK     (0x4)
8088c2ecf20Sopenharmony_ci
8098c2ecf20Sopenharmony_ci/** SHFL_FN_REMOVE Parameters structure. */
8108c2ecf20Sopenharmony_cistruct shfl_remove {
8118c2ecf20Sopenharmony_ci	/**
8128c2ecf20Sopenharmony_ci	 * pointer, in: SHFLROOT (u32)
8138c2ecf20Sopenharmony_ci	 * Root handle of the mapping which name is queried.
8148c2ecf20Sopenharmony_ci	 */
8158c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter root;
8168c2ecf20Sopenharmony_ci
8178c2ecf20Sopenharmony_ci	/**
8188c2ecf20Sopenharmony_ci	 * pointer, in:
8198c2ecf20Sopenharmony_ci	 * Points to struct shfl_string buffer.
8208c2ecf20Sopenharmony_ci	 */
8218c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter path;
8228c2ecf20Sopenharmony_ci
8238c2ecf20Sopenharmony_ci	/**
8248c2ecf20Sopenharmony_ci	 * value32, in:
8258c2ecf20Sopenharmony_ci	 * remove flags (file/directory)
8268c2ecf20Sopenharmony_ci	 */
8278c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter flags;
8288c2ecf20Sopenharmony_ci
8298c2ecf20Sopenharmony_ci};
8308c2ecf20Sopenharmony_ci
8318c2ecf20Sopenharmony_ci#define SHFL_CPARMS_REMOVE  (3)
8328c2ecf20Sopenharmony_ci
8338c2ecf20Sopenharmony_ci
8348c2ecf20Sopenharmony_ci/* SHFL_FN_RENAME */
8358c2ecf20Sopenharmony_ci
8368c2ecf20Sopenharmony_ci#define SHFL_RENAME_FILE                (0x1)
8378c2ecf20Sopenharmony_ci#define SHFL_RENAME_DIR                 (0x2)
8388c2ecf20Sopenharmony_ci#define SHFL_RENAME_REPLACE_IF_EXISTS   (0x4)
8398c2ecf20Sopenharmony_ci
8408c2ecf20Sopenharmony_ci/** SHFL_FN_RENAME Parameters structure. */
8418c2ecf20Sopenharmony_cistruct shfl_rename {
8428c2ecf20Sopenharmony_ci	/**
8438c2ecf20Sopenharmony_ci	 * pointer, in: SHFLROOT (u32)
8448c2ecf20Sopenharmony_ci	 * Root handle of the mapping which name is queried.
8458c2ecf20Sopenharmony_ci	 */
8468c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter root;
8478c2ecf20Sopenharmony_ci
8488c2ecf20Sopenharmony_ci	/**
8498c2ecf20Sopenharmony_ci	 * pointer, in:
8508c2ecf20Sopenharmony_ci	 * Points to struct shfl_string src.
8518c2ecf20Sopenharmony_ci	 */
8528c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter src;
8538c2ecf20Sopenharmony_ci
8548c2ecf20Sopenharmony_ci	/**
8558c2ecf20Sopenharmony_ci	 * pointer, in:
8568c2ecf20Sopenharmony_ci	 * Points to struct shfl_string dest.
8578c2ecf20Sopenharmony_ci	 */
8588c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter dest;
8598c2ecf20Sopenharmony_ci
8608c2ecf20Sopenharmony_ci	/**
8618c2ecf20Sopenharmony_ci	 * value32, in:
8628c2ecf20Sopenharmony_ci	 * rename flags (file/directory)
8638c2ecf20Sopenharmony_ci	 */
8648c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter flags;
8658c2ecf20Sopenharmony_ci
8668c2ecf20Sopenharmony_ci};
8678c2ecf20Sopenharmony_ci
8688c2ecf20Sopenharmony_ci#define SHFL_CPARMS_RENAME  (4)
8698c2ecf20Sopenharmony_ci
8708c2ecf20Sopenharmony_ci
8718c2ecf20Sopenharmony_ci/** SHFL_FN_SYMLINK Parameters structure. */
8728c2ecf20Sopenharmony_cistruct shfl_symlink {
8738c2ecf20Sopenharmony_ci	/**
8748c2ecf20Sopenharmony_ci	 * pointer, in: SHFLROOT (u32)
8758c2ecf20Sopenharmony_ci	 * Root handle of the mapping which name is queried.
8768c2ecf20Sopenharmony_ci	 */
8778c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter root;
8788c2ecf20Sopenharmony_ci
8798c2ecf20Sopenharmony_ci	/**
8808c2ecf20Sopenharmony_ci	 * pointer, in:
8818c2ecf20Sopenharmony_ci	 * Points to struct shfl_string of path for the new symlink.
8828c2ecf20Sopenharmony_ci	 */
8838c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter new_path;
8848c2ecf20Sopenharmony_ci
8858c2ecf20Sopenharmony_ci	/**
8868c2ecf20Sopenharmony_ci	 * pointer, in:
8878c2ecf20Sopenharmony_ci	 * Points to struct shfl_string of destination for symlink.
8888c2ecf20Sopenharmony_ci	 */
8898c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter old_path;
8908c2ecf20Sopenharmony_ci
8918c2ecf20Sopenharmony_ci	/**
8928c2ecf20Sopenharmony_ci	 * pointer, out:
8938c2ecf20Sopenharmony_ci	 * Information about created symlink.
8948c2ecf20Sopenharmony_ci	 */
8958c2ecf20Sopenharmony_ci	struct vmmdev_hgcm_function_parameter info;
8968c2ecf20Sopenharmony_ci
8978c2ecf20Sopenharmony_ci};
8988c2ecf20Sopenharmony_ci
8998c2ecf20Sopenharmony_ci#define SHFL_CPARMS_SYMLINK  (4)
9008c2ecf20Sopenharmony_ci
9018c2ecf20Sopenharmony_ci#endif
902