18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef _SCSI_IOCTL_H
38c2ecf20Sopenharmony_ci#define _SCSI_IOCTL_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#define SCSI_IOCTL_SEND_COMMAND 1
68c2ecf20Sopenharmony_ci#define SCSI_IOCTL_TEST_UNIT_READY 2
78c2ecf20Sopenharmony_ci#define SCSI_IOCTL_BENCHMARK_COMMAND 3
88c2ecf20Sopenharmony_ci#define SCSI_IOCTL_SYNC 4			/* Request synchronous parameters */
98c2ecf20Sopenharmony_ci#define SCSI_IOCTL_START_UNIT 5
108c2ecf20Sopenharmony_ci#define SCSI_IOCTL_STOP_UNIT 6
118c2ecf20Sopenharmony_ci/* The door lock/unlock constants are compatible with Sun constants for
128c2ecf20Sopenharmony_ci   the cdrom */
138c2ecf20Sopenharmony_ci#define SCSI_IOCTL_DOORLOCK 0x5380		/* lock the eject mechanism */
148c2ecf20Sopenharmony_ci#define SCSI_IOCTL_DOORUNLOCK 0x5381		/* unlock the mechanism	  */
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#define	SCSI_REMOVAL_PREVENT	1
178c2ecf20Sopenharmony_ci#define	SCSI_REMOVAL_ALLOW	0
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#ifdef __KERNEL__
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_cistruct scsi_device;
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci/*
248c2ecf20Sopenharmony_ci * Structures used for scsi_ioctl et al.
258c2ecf20Sopenharmony_ci */
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_citypedef struct scsi_ioctl_command {
288c2ecf20Sopenharmony_ci	unsigned int inlen;
298c2ecf20Sopenharmony_ci	unsigned int outlen;
308c2ecf20Sopenharmony_ci	unsigned char data[];
318c2ecf20Sopenharmony_ci} Scsi_Ioctl_Command;
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_citypedef struct scsi_idlun {
348c2ecf20Sopenharmony_ci	__u32 dev_id;
358c2ecf20Sopenharmony_ci	__u32 host_unique_id;
368c2ecf20Sopenharmony_ci} Scsi_Idlun;
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci/* Fibre Channel WWN, port_id struct */
398c2ecf20Sopenharmony_citypedef struct scsi_fctargaddress {
408c2ecf20Sopenharmony_ci	__u32 host_port_id;
418c2ecf20Sopenharmony_ci	unsigned char host_wwn[8]; // include NULL term.
428c2ecf20Sopenharmony_ci} Scsi_FCTargAddress;
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ciint scsi_ioctl_block_when_processing_errors(struct scsi_device *sdev,
458c2ecf20Sopenharmony_ci		int cmd, bool ndelay);
468c2ecf20Sopenharmony_ciextern int scsi_ioctl(struct scsi_device *, int, void __user *);
478c2ecf20Sopenharmony_ciextern int scsi_compat_ioctl(struct scsi_device *sdev, int cmd, void __user *arg);
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci#endif /* __KERNEL__ */
508c2ecf20Sopenharmony_ci#endif /* _SCSI_IOCTL_H */
51