tcm_qla2xxx.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #include <target/target_core_base.h>
  3. #include <linux/btree.h>
  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 fc_port */
  21. struct fc_port *fc_port;
  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. };
  46. struct tcm_qla2xxx_fc_loopid {
  47. struct se_node_acl *se_nacl;
  48. };
  49. struct tcm_qla2xxx_lport {
  50. /* Binary World Wide unique Port Name for FC Target Lport */
  51. u64 lport_wwpn;
  52. /* Binary World Wide unique Port Name for FC NPIV Target Lport */
  53. u64 lport_npiv_wwpn;
  54. /* Binary World Wide unique Node Name for FC NPIV Target Lport */
  55. u64 lport_npiv_wwnn;
  56. /* ASCII formatted WWPN for FC Target Lport */
  57. char lport_name[TCM_QLA2XXX_NAMELEN];
  58. /* ASCII formatted naa WWPN for VPD page 83 etc */
  59. char lport_naa_name[TCM_QLA2XXX_NAMELEN];
  60. /* map for fc_port pointers in 24-bit FC Port ID space */
  61. struct btree_head32 lport_fcport_map;
  62. /* vmalloc-ed memory for fc_port pointers for 16-bit FC loop ID */
  63. struct tcm_qla2xxx_fc_loopid *lport_loopid_map;
  64. /* Pointer to struct scsi_qla_host from qla2xxx LLD */
  65. struct scsi_qla_host *qla_vha;
  66. /* Pointer to struct qla_tgt pointer */
  67. struct qla_tgt lport_qla_tgt;
  68. /* Pointer to TPG=1 for non NPIV mode */
  69. struct tcm_qla2xxx_tpg *tpg_1;
  70. /* Returned by tcm_qla2xxx_make_lport() */
  71. struct se_wwn lport_wwn;
  72. };