tcm_qla2xxx.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #include <target/target_core_base.h>
  2. #include <linux/btree.h>
  3. #define TCM_QLA2XXX_VERSION "v0.1"
  4. /* length of ASCII WWPNs including pad */
  5. #define TCM_QLA2XXX_NAMELEN 32
  6. /*
  7. * Number of pre-allocated per-session tags, based upon the worst-case
  8. * per port number of iocbs
  9. */
  10. #define TCM_QLA2XXX_DEFAULT_TAGS 2088
  11. #include "qla_target.h"
  12. struct tcm_qla2xxx_nacl {
  13. struct se_node_acl se_node_acl;
  14. /* From libfc struct fc_rport->port_id */
  15. u32 nport_id;
  16. /* Binary World Wide unique Node Name for remote FC Initiator Nport */
  17. u64 nport_wwnn;
  18. /* ASCII formatted WWPN for FC Initiator Nport */
  19. char nport_name[TCM_QLA2XXX_NAMELEN];
  20. /* Pointer to qla_tgt_sess */
  21. struct qla_tgt_sess *qla_tgt_sess;
  22. /* Pointer to TCM FC nexus */
  23. struct se_session *nport_nexus;
  24. };
  25. struct tcm_qla2xxx_tpg_attrib {
  26. int generate_node_acls;
  27. int cache_dynamic_acls;
  28. int demo_mode_write_protect;
  29. int prod_mode_write_protect;
  30. int demo_mode_login_only;
  31. int fabric_prot_type;
  32. int jam_host;
  33. };
  34. struct tcm_qla2xxx_tpg {
  35. /* FC lport target portal group tag for TCM */
  36. u16 lport_tpgt;
  37. /* Atomic bit to determine TPG active status */
  38. atomic_t lport_tpg_enabled;
  39. /* Pointer back to tcm_qla2xxx_lport */
  40. struct tcm_qla2xxx_lport *lport;
  41. /* Used by tcm_qla2xxx_tpg_attrib_cit */
  42. struct tcm_qla2xxx_tpg_attrib tpg_attrib;
  43. /* Returned by tcm_qla2xxx_make_tpg() */
  44. struct se_portal_group se_tpg;
  45. /* Items for dealing with configfs_depend_item */
  46. struct completion tpg_base_comp;
  47. struct work_struct tpg_base_work;
  48. };
  49. struct tcm_qla2xxx_fc_loopid {
  50. struct se_node_acl *se_nacl;
  51. };
  52. struct tcm_qla2xxx_lport {
  53. /* Binary World Wide unique Port Name for FC Target Lport */
  54. u64 lport_wwpn;
  55. /* Binary World Wide unique Port Name for FC NPIV Target Lport */
  56. u64 lport_npiv_wwpn;
  57. /* Binary World Wide unique Node Name for FC NPIV Target Lport */
  58. u64 lport_npiv_wwnn;
  59. /* ASCII formatted WWPN for FC Target Lport */
  60. char lport_name[TCM_QLA2XXX_NAMELEN];
  61. /* ASCII formatted naa WWPN for VPD page 83 etc */
  62. char lport_naa_name[TCM_QLA2XXX_NAMELEN];
  63. /* map for fc_port pointers in 24-bit FC Port ID space */
  64. struct btree_head32 lport_fcport_map;
  65. /* vmalloc-ed memory for fc_port pointers for 16-bit FC loop ID */
  66. struct tcm_qla2xxx_fc_loopid *lport_loopid_map;
  67. /* Pointer to struct scsi_qla_host from qla2xxx LLD */
  68. struct scsi_qla_host *qla_vha;
  69. /* Pointer to struct qla_tgt pointer */
  70. struct qla_tgt lport_qla_tgt;
  71. /* Pointer to TPG=1 for non NPIV mode */
  72. struct tcm_qla2xxx_tpg *tpg_1;
  73. /* Returned by tcm_qla2xxx_make_lport() */
  74. struct se_wwn lport_wwn;
  75. };