target_core_pscsi.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. struct pscsi_plugin_task {
  20. unsigned char pscsi_cdb[0];
  21. } ____cacheline_aligned;
  22. #define PDF_HAS_CHANNEL_ID 0x01
  23. #define PDF_HAS_TARGET_ID 0x02
  24. #define PDF_HAS_LUN_ID 0x04
  25. #define PDF_HAS_VPD_UNIT_SERIAL 0x08
  26. #define PDF_HAS_VPD_DEV_IDENT 0x10
  27. #define PDF_HAS_VIRT_HOST_ID 0x20
  28. struct pscsi_dev_virt {
  29. struct se_device dev;
  30. int pdv_flags;
  31. int pdv_host_id;
  32. int pdv_channel_id;
  33. int pdv_target_id;
  34. int pdv_lun_id;
  35. struct block_device *pdv_bd;
  36. struct scsi_device *pdv_sd;
  37. struct Scsi_Host *pdv_lld_host;
  38. } ____cacheline_aligned;
  39. typedef enum phv_modes {
  40. PHV_VIRTUAL_HOST_ID,
  41. PHV_LLD_SCSI_HOST_NO
  42. } phv_modes_t;
  43. struct pscsi_hba_virt {
  44. int phv_host_id;
  45. phv_modes_t phv_mode;
  46. struct Scsi_Host *phv_lld_host;
  47. } ____cacheline_aligned;
  48. #endif /*** TARGET_CORE_PSCSI_H ***/