target_core_pscsi.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef TARGET_CORE_PSCSI_H
  3. #define TARGET_CORE_PSCSI_H
  4. #define PSCSI_VERSION "v4.0"
  5. /* used in pscsi_find_alloc_len() */
  6. #ifndef INQUIRY_DATA_SIZE
  7. #define INQUIRY_DATA_SIZE 0x24
  8. #endif
  9. /* used in pscsi_add_device_to_list() */
  10. #define PSCSI_DEFAULT_QUEUEDEPTH 1
  11. #define PS_RETRY 5
  12. #define PS_TIMEOUT_DISK (15*HZ)
  13. #define PS_TIMEOUT_OTHER (500*HZ)
  14. #include <linux/cache.h> /* ___cacheline_aligned */
  15. #include <target/target_core_base.h> /* struct se_device */
  16. struct block_device;
  17. struct scsi_device;
  18. struct Scsi_Host;
  19. #define PDF_HAS_CHANNEL_ID 0x01
  20. #define PDF_HAS_TARGET_ID 0x02
  21. #define PDF_HAS_LUN_ID 0x04
  22. #define PDF_HAS_VPD_UNIT_SERIAL 0x08
  23. #define PDF_HAS_VPD_DEV_IDENT 0x10
  24. #define PDF_HAS_VIRT_HOST_ID 0x20
  25. struct pscsi_dev_virt {
  26. struct se_device dev;
  27. int pdv_flags;
  28. int pdv_host_id;
  29. int pdv_channel_id;
  30. int pdv_target_id;
  31. int pdv_lun_id;
  32. struct file *pdv_bdev_file;
  33. struct scsi_device *pdv_sd;
  34. struct Scsi_Host *pdv_lld_host;
  35. } ____cacheline_aligned;
  36. typedef enum phv_modes {
  37. PHV_VIRTUAL_HOST_ID,
  38. PHV_LLD_SCSI_HOST_NO
  39. } phv_modes_t;
  40. struct pscsi_hba_virt {
  41. int phv_host_id;
  42. phv_modes_t phv_mode;
  43. struct Scsi_Host *phv_lld_host;
  44. } ____cacheline_aligned;
  45. #endif /*** TARGET_CORE_PSCSI_H ***/