target_core_pscsi.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 <scsi/scsi_driver.h>
  15. #include <scsi/scsi_device.h>
  16. #include <linux/kref.h>
  17. #include <linux/kobject.h>
  18. struct pscsi_plugin_task {
  19. struct se_task pscsi_task;
  20. unsigned char pscsi_sense[SCSI_SENSE_BUFFERSIZE];
  21. int pscsi_direction;
  22. int pscsi_result;
  23. u32 pscsi_resid;
  24. unsigned char pscsi_cdb[0];
  25. } ____cacheline_aligned;
  26. #define PDF_HAS_CHANNEL_ID 0x01
  27. #define PDF_HAS_TARGET_ID 0x02
  28. #define PDF_HAS_LUN_ID 0x04
  29. #define PDF_HAS_VPD_UNIT_SERIAL 0x08
  30. #define PDF_HAS_VPD_DEV_IDENT 0x10
  31. #define PDF_HAS_VIRT_HOST_ID 0x20
  32. struct pscsi_dev_virt {
  33. int pdv_flags;
  34. int pdv_host_id;
  35. int pdv_channel_id;
  36. int pdv_target_id;
  37. int pdv_lun_id;
  38. struct block_device *pdv_bd;
  39. struct scsi_device *pdv_sd;
  40. struct Scsi_Host *pdv_lld_host;
  41. struct se_hba *pdv_se_hba;
  42. } ____cacheline_aligned;
  43. typedef enum phv_modes {
  44. PHV_VIRTUAL_HOST_ID,
  45. PHV_LLD_SCSI_HOST_NO
  46. } phv_modes_t;
  47. struct pscsi_hba_virt {
  48. int phv_host_id;
  49. phv_modes_t phv_mode;
  50. struct Scsi_Host *phv_lld_host;
  51. } ____cacheline_aligned;
  52. #endif /*** TARGET_CORE_PSCSI_H ***/