target_core_pscsi.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifndef TARGET_CORE_PSCSI_H
  2. #define TARGET_CORE_PSCSI_H
  3. #define PSCSI_VERSION "v4.0"
  4. /* used in pscsi_find_alloc_len() */
  5. #ifndef INQUIRY_DATA_SIZE
  6. #define INQUIRY_DATA_SIZE 0x24
  7. #endif
  8. /* used in pscsi_add_device_to_list() */
  9. #define PSCSI_DEFAULT_QUEUEDEPTH 1
  10. #define PS_RETRY 5
  11. #define PS_TIMEOUT_DISK (15*HZ)
  12. #define PS_TIMEOUT_OTHER (500*HZ)
  13. #include <linux/device.h>
  14. #include <linux/kref.h>
  15. #include <linux/kobject.h>
  16. struct scsi_device;
  17. struct pscsi_plugin_task {
  18. unsigned char pscsi_sense[TRANSPORT_SENSE_BUFFER];
  19. int pscsi_direction;
  20. int pscsi_result;
  21. u32 pscsi_resid;
  22. unsigned char pscsi_cdb[0];
  23. } ____cacheline_aligned;
  24. #define PDF_HAS_CHANNEL_ID 0x01
  25. #define PDF_HAS_TARGET_ID 0x02
  26. #define PDF_HAS_LUN_ID 0x04
  27. #define PDF_HAS_VPD_UNIT_SERIAL 0x08
  28. #define PDF_HAS_VPD_DEV_IDENT 0x10
  29. #define PDF_HAS_VIRT_HOST_ID 0x20
  30. struct pscsi_dev_virt {
  31. struct se_device dev;
  32. int pdv_flags;
  33. int pdv_host_id;
  34. int pdv_channel_id;
  35. int pdv_target_id;
  36. int pdv_lun_id;
  37. struct block_device *pdv_bd;
  38. struct scsi_device *pdv_sd;
  39. struct Scsi_Host *pdv_lld_host;
  40. } ____cacheline_aligned;
  41. typedef enum phv_modes {
  42. PHV_VIRTUAL_HOST_ID,
  43. PHV_LLD_SCSI_HOST_NO
  44. } phv_modes_t;
  45. struct pscsi_hba_virt {
  46. int phv_host_id;
  47. phv_modes_t phv_mode;
  48. struct Scsi_Host *phv_lld_host;
  49. } ____cacheline_aligned;
  50. #endif /*** TARGET_CORE_PSCSI_H ***/