18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci *   fs/cifs/cifs_ioctl.h
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci *   Structure definitions for io control for cifs/smb3
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci *   Copyright (c) 2015 Steve French <steve.french@primarydata.com>
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci *   This library is free software; you can redistribute it and/or modify
98c2ecf20Sopenharmony_ci *   it under the terms of the GNU Lesser General Public License as published
108c2ecf20Sopenharmony_ci *   by the Free Software Foundation; either version 2.1 of the License, or
118c2ecf20Sopenharmony_ci *   (at your option) any later version.
128c2ecf20Sopenharmony_ci *
138c2ecf20Sopenharmony_ci *   This library is distributed in the hope that it will be useful,
148c2ecf20Sopenharmony_ci *   but WITHOUT ANY WARRANTY; without even the implied warranty of
158c2ecf20Sopenharmony_ci *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
168c2ecf20Sopenharmony_ci *   the GNU Lesser General Public License for more details.
178c2ecf20Sopenharmony_ci *
188c2ecf20Sopenharmony_ci */
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_cistruct smb_mnt_fs_info {
218c2ecf20Sopenharmony_ci	__u32	version; /* 0001 */
228c2ecf20Sopenharmony_ci	__u16	protocol_id;
238c2ecf20Sopenharmony_ci	__u16	tcon_flags;
248c2ecf20Sopenharmony_ci	__u32	vol_serial_number;
258c2ecf20Sopenharmony_ci	__u32	vol_create_time;
268c2ecf20Sopenharmony_ci	__u32	share_caps;
278c2ecf20Sopenharmony_ci	__u32	share_flags;
288c2ecf20Sopenharmony_ci	__u32	sector_flags;
298c2ecf20Sopenharmony_ci	__u32	optimal_sector_size;
308c2ecf20Sopenharmony_ci	__u32	max_bytes_chunk;
318c2ecf20Sopenharmony_ci	__u32	fs_attributes;
328c2ecf20Sopenharmony_ci	__u32	max_path_component;
338c2ecf20Sopenharmony_ci	__u32	device_type;
348c2ecf20Sopenharmony_ci	__u32	device_characteristics;
358c2ecf20Sopenharmony_ci	__u32	maximal_access;
368c2ecf20Sopenharmony_ci	__u64   cifs_posix_caps;
378c2ecf20Sopenharmony_ci} __packed;
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_cistruct smb_snapshot_array {
408c2ecf20Sopenharmony_ci	__u32	number_of_snapshots;
418c2ecf20Sopenharmony_ci	__u32	number_of_snapshots_returned;
428c2ecf20Sopenharmony_ci	__u32	snapshot_array_size;
438c2ecf20Sopenharmony_ci	/*	snapshots[]; */
448c2ecf20Sopenharmony_ci} __packed;
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci/* query_info flags */
478c2ecf20Sopenharmony_ci#define PASSTHRU_QUERY_INFO	0x00000000
488c2ecf20Sopenharmony_ci#define PASSTHRU_FSCTL		0x00000001
498c2ecf20Sopenharmony_ci#define PASSTHRU_SET_INFO	0x00000002
508c2ecf20Sopenharmony_cistruct smb_query_info {
518c2ecf20Sopenharmony_ci	__u32   info_type;
528c2ecf20Sopenharmony_ci	__u32   file_info_class;
538c2ecf20Sopenharmony_ci	__u32   additional_information;
548c2ecf20Sopenharmony_ci	__u32   flags;
558c2ecf20Sopenharmony_ci	__u32	input_buffer_length;
568c2ecf20Sopenharmony_ci	__u32	output_buffer_length;
578c2ecf20Sopenharmony_ci	/* char buffer[]; */
588c2ecf20Sopenharmony_ci} __packed;
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_cistruct smb3_key_debug_info {
618c2ecf20Sopenharmony_ci	__u64	Suid;
628c2ecf20Sopenharmony_ci	__u16	cipher_type;
638c2ecf20Sopenharmony_ci	__u8	auth_key[16]; /* SMB2_NTLMV2_SESSKEY_SIZE */
648c2ecf20Sopenharmony_ci	__u8	smb3encryptionkey[SMB3_SIGN_KEY_SIZE];
658c2ecf20Sopenharmony_ci	__u8	smb3decryptionkey[SMB3_SIGN_KEY_SIZE];
668c2ecf20Sopenharmony_ci} __packed;
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_cistruct smb3_notify {
698c2ecf20Sopenharmony_ci	__u32	completion_filter;
708c2ecf20Sopenharmony_ci	bool	watch_tree;
718c2ecf20Sopenharmony_ci} __packed;
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci#define CIFS_IOCTL_MAGIC	0xCF
748c2ecf20Sopenharmony_ci#define CIFS_IOC_COPYCHUNK_FILE	_IOW(CIFS_IOCTL_MAGIC, 3, int)
758c2ecf20Sopenharmony_ci#define CIFS_IOC_SET_INTEGRITY  _IO(CIFS_IOCTL_MAGIC, 4)
768c2ecf20Sopenharmony_ci#define CIFS_IOC_GET_MNT_INFO _IOR(CIFS_IOCTL_MAGIC, 5, struct smb_mnt_fs_info)
778c2ecf20Sopenharmony_ci#define CIFS_ENUMERATE_SNAPSHOTS _IOR(CIFS_IOCTL_MAGIC, 6, struct smb_snapshot_array)
788c2ecf20Sopenharmony_ci#define CIFS_QUERY_INFO _IOWR(CIFS_IOCTL_MAGIC, 7, struct smb_query_info)
798c2ecf20Sopenharmony_ci#define CIFS_DUMP_KEY _IOWR(CIFS_IOCTL_MAGIC, 8, struct smb3_key_debug_info)
808c2ecf20Sopenharmony_ci#define CIFS_IOC_NOTIFY _IOW(CIFS_IOCTL_MAGIC, 9, struct smb3_notify)
81