scsi_ioctl.h 1.2 KB

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