tcm_loop.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #include <linux/types.h>
  2. #include <linux/device.h>
  3. #include <target/target_core_base.h> /* struct se_cmd */
  4. #define TCM_LOOP_VERSION "v2.1-rc2"
  5. #define TL_WWN_ADDR_LEN 256
  6. #define TL_TPGS_PER_HBA 32
  7. struct tcm_loop_cmd {
  8. /* State of Linux/SCSI CDB+Data descriptor */
  9. u32 sc_cmd_state;
  10. /* Tagged command queueing */
  11. u32 sc_cmd_tag;
  12. /* Pointer to the CDB+Data descriptor from Linux/SCSI subsystem */
  13. struct scsi_cmnd *sc;
  14. /* The TCM I/O descriptor that is accessed via container_of() */
  15. struct se_cmd tl_se_cmd;
  16. struct work_struct work;
  17. /* Sense buffer that will be mapped into outgoing status */
  18. unsigned char tl_sense_buf[TRANSPORT_SENSE_BUFFER];
  19. };
  20. struct tcm_loop_tmr {
  21. atomic_t tmr_complete;
  22. wait_queue_head_t tl_tmr_wait;
  23. };
  24. struct tcm_loop_nexus {
  25. /*
  26. * Pointer to TCM session for I_T Nexus
  27. */
  28. struct se_session *se_sess;
  29. };
  30. #define TCM_TRANSPORT_ONLINE 0
  31. #define TCM_TRANSPORT_OFFLINE 1
  32. struct tcm_loop_tpg {
  33. unsigned short tl_tpgt;
  34. unsigned short tl_transport_status;
  35. enum target_prot_type tl_fabric_prot_type;
  36. atomic_t tl_tpg_port_count;
  37. struct se_portal_group tl_se_tpg;
  38. struct tcm_loop_hba *tl_hba;
  39. struct tcm_loop_nexus *tl_nexus;
  40. };
  41. struct tcm_loop_hba {
  42. u8 tl_proto_id;
  43. unsigned char tl_wwn_address[TL_WWN_ADDR_LEN];
  44. struct se_hba_s *se_hba;
  45. struct se_lun *tl_hba_lun;
  46. struct se_port *tl_hba_lun_sep;
  47. struct device dev;
  48. struct Scsi_Host *sh;
  49. struct tcm_loop_tpg tl_hba_tpgs[TL_TPGS_PER_HBA];
  50. struct se_wwn tl_hba_wwn;
  51. };