vscsivar.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* $OpenBSD: vscsivar.h,v 1.5 2011/04/05 15:28:49 dlg Exp $ */
  2. /*
  3. * Copyright (c) 2008 David Gwynne <dlg@openbsd.org>
  4. *
  5. * Permission to use, copy, modify, and distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. #ifndef _SYS_DEV_VSCSIVAR_H
  18. #define _SYS_DEV_VSCSIVAR_H
  19. struct vscsi_ioc_i2t {
  20. int tag;
  21. u_int target;
  22. u_int lun;
  23. struct scsi_generic cmd;
  24. size_t cmdlen;
  25. size_t datalen;
  26. int direction;
  27. #define VSCSI_DIR_NONE 0
  28. #define VSCSI_DIR_READ 1
  29. #define VSCSI_DIR_WRITE 2
  30. };
  31. #define VSCSI_I2T _IOR('I', 0, struct vscsi_ioc_i2t)
  32. struct vscsi_ioc_data {
  33. int tag;
  34. void * data;
  35. size_t datalen;
  36. };
  37. #define VSCSI_DATA_READ _IOW('I', 1, struct vscsi_ioc_data)
  38. #define VSCSI_DATA_WRITE _IOW('I', 2, struct vscsi_ioc_data)
  39. struct vscsi_ioc_t2i {
  40. int tag;
  41. int status;
  42. #define VSCSI_STAT_DONE 0
  43. #define VSCSI_STAT_SENSE 1
  44. #define VSCSI_STAT_RESET 2
  45. #define VSCSI_STAT_ERR 3
  46. struct scsi_sense_data sense;
  47. };
  48. #define VSCSI_T2I _IOW('I', 3, struct vscsi_ioc_t2i)
  49. struct vscsi_ioc_devevent {
  50. int target;
  51. int lun;
  52. };
  53. #define VSCSI_REQPROBE _IOW('I', 4, struct vscsi_ioc_devevent)
  54. #define VSCSI_REQDETACH _IOW('I', 5, struct vscsi_ioc_devevent)
  55. #endif /* _SYS_DEV_VSCSIVAR_H */