target_core_pscsi.h 1.5 KB

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