Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _SCSI_IOCTL_H
0003 #define _SCSI_IOCTL_H 
0004 
0005 #define SCSI_IOCTL_SEND_COMMAND 1
0006 #define SCSI_IOCTL_TEST_UNIT_READY 2
0007 #define SCSI_IOCTL_BENCHMARK_COMMAND 3
0008 #define SCSI_IOCTL_SYNC 4           /* Request synchronous parameters */
0009 #define SCSI_IOCTL_START_UNIT 5
0010 #define SCSI_IOCTL_STOP_UNIT 6
0011 /* The door lock/unlock constants are compatible with Sun constants for
0012    the cdrom */
0013 #define SCSI_IOCTL_DOORLOCK 0x5380      /* lock the eject mechanism */
0014 #define SCSI_IOCTL_DOORUNLOCK 0x5381        /* unlock the mechanism   */
0015 
0016 #define SCSI_REMOVAL_PREVENT    1
0017 #define SCSI_REMOVAL_ALLOW  0
0018 
0019 #ifdef __KERNEL__
0020 
0021 struct gendisk;
0022 struct scsi_device;
0023 struct sg_io_hdr;
0024 
0025 /*
0026  * Structures used for scsi_ioctl et al.
0027  */
0028 
0029 typedef struct scsi_ioctl_command {
0030     unsigned int inlen;
0031     unsigned int outlen;
0032     unsigned char data[];
0033 } Scsi_Ioctl_Command;
0034 
0035 typedef struct scsi_idlun {
0036     __u32 dev_id;
0037     __u32 host_unique_id;
0038 } Scsi_Idlun;
0039 
0040 /* Fibre Channel WWN, port_id struct */
0041 typedef struct scsi_fctargaddress {
0042     __u32 host_port_id;
0043     unsigned char host_wwn[8]; // include NULL term.
0044 } Scsi_FCTargAddress;
0045 
0046 int scsi_ioctl_block_when_processing_errors(struct scsi_device *sdev,
0047         int cmd, bool ndelay);
0048 int scsi_ioctl(struct scsi_device *sdev, fmode_t mode, int cmd,
0049         void __user *arg);
0050 int get_sg_io_hdr(struct sg_io_hdr *hdr, const void __user *argp);
0051 int put_sg_io_hdr(const struct sg_io_hdr *hdr, void __user *argp);
0052 bool scsi_cmd_allowed(unsigned char *cmd, fmode_t mode);
0053 
0054 #endif /* __KERNEL__ */
0055 #endif /* _SCSI_IOCTL_H */