scsi_ioctl.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _SCSI_IOCTL_H
  3. #define _SCSI_IOCTL_H
  4. #define SCSI_IOCTL_SEND_COMMAND 1
  5. #define SCSI_IOCTL_TEST_UNIT_READY 2
  6. #define SCSI_IOCTL_BENCHMARK_COMMAND 3
  7. #define SCSI_IOCTL_SYNC 4 /* Request synchronous parameters */
  8. #define SCSI_IOCTL_START_UNIT 5
  9. #define SCSI_IOCTL_STOP_UNIT 6
  10. /* The door lock/unlock constants are compatible with Sun constants for
  11. the cdrom */
  12. #define SCSI_IOCTL_DOORLOCK 0x5380 /* lock the eject mechanism */
  13. #define SCSI_IOCTL_DOORUNLOCK 0x5381 /* unlock the mechanism */
  14. #define SCSI_REMOVAL_PREVENT 1
  15. #define SCSI_REMOVAL_ALLOW 0
  16. #ifdef __KERNEL__
  17. struct scsi_device;
  18. /*
  19. * Structures used for scsi_ioctl et al.
  20. */
  21. typedef struct scsi_ioctl_command {
  22. unsigned int inlen;
  23. unsigned int outlen;
  24. unsigned char data[0];
  25. } Scsi_Ioctl_Command;
  26. typedef struct scsi_idlun {
  27. __u32 dev_id;
  28. __u32 host_unique_id;
  29. } Scsi_Idlun;
  30. /* Fibre Channel WWN, port_id struct */
  31. typedef struct scsi_fctargaddress {
  32. __u32 host_port_id;
  33. unsigned char host_wwn[8]; // include NULL term.
  34. } Scsi_FCTargAddress;
  35. int scsi_ioctl_block_when_processing_errors(struct scsi_device *sdev,
  36. int cmd, bool ndelay);
  37. extern int scsi_ioctl(struct scsi_device *, int, void __user *);
  38. #endif /* __KERNEL__ */
  39. #endif /* _SCSI_IOCTL_H */