tcm_loop.h 1.3 KB

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