tcm_qla2xxx.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. };
  33. struct tcm_qla2xxx_tpg {
  34. /* FC lport target portal group tag for TCM */
  35. u16 lport_tpgt;
  36. /* Atomic bit to determine TPG active status */
  37. atomic_t lport_tpg_enabled;
  38. /* Pointer back to tcm_qla2xxx_lport */
  39. struct tcm_qla2xxx_lport *lport;
  40. /* Used by tcm_qla2xxx_tpg_attrib_cit */
  41. struct tcm_qla2xxx_tpg_attrib tpg_attrib;
  42. /* Returned by tcm_qla2xxx_make_tpg() */
  43. struct se_portal_group se_tpg;
  44. /* Items for dealing with configfs_depend_item */
  45. struct completion tpg_base_comp;
  46. struct work_struct tpg_base_work;
  47. };
  48. struct tcm_qla2xxx_fc_loopid {
  49. struct se_node_acl *se_nacl;
  50. };
  51. struct tcm_qla2xxx_lport {
  52. /* Binary World Wide unique Port Name for FC Target Lport */
  53. u64 lport_wwpn;
  54. /* Binary World Wide unique Port Name for FC NPIV Target Lport */
  55. u64 lport_npiv_wwpn;
  56. /* Binary World Wide unique Node Name for FC NPIV Target Lport */
  57. u64 lport_npiv_wwnn;
  58. /* ASCII formatted WWPN for FC Target Lport */
  59. char lport_name[TCM_QLA2XXX_NAMELEN];
  60. /* ASCII formatted naa WWPN for VPD page 83 etc */
  61. char lport_naa_name[TCM_QLA2XXX_NAMELEN];
  62. /* map for fc_port pointers in 24-bit FC Port ID space */
  63. struct btree_head32 lport_fcport_map;
  64. /* vmalloc-ed memory for fc_port pointers for 16-bit FC loop ID */
  65. struct tcm_qla2xxx_fc_loopid *lport_loopid_map;
  66. /* Pointer to struct scsi_qla_host from qla2xxx LLD */
  67. struct scsi_qla_host *qla_vha;
  68. /* Pointer to struct qla_tgt pointer */
  69. struct qla_tgt lport_qla_tgt;
  70. /* Pointer to TPG=1 for non NPIV mode */
  71. struct tcm_qla2xxx_tpg *tpg_1;
  72. /* Returned by tcm_qla2xxx_make_lport() */
  73. struct se_wwn lport_wwn;
  74. };