blob: 33aaac8c7d5936bbdd3e2d9f934f2c92f2083331 [file] [log] [blame]
Nicholas Bellinger75f8c1f2012-05-15 14:34:29 -04001#include <target/target_core_base.h>
2#include <linux/btree.h>
3
4#define TCM_QLA2XXX_VERSION "v0.1"
5/* length of ASCII WWPNs including pad */
6#define TCM_QLA2XXX_NAMELEN 32
Nicholas Bellinger75f8c1f2012-05-15 14:34:29 -04007
8#include "qla_target.h"
9
10struct tcm_qla2xxx_nacl {
11 /* From libfc struct fc_rport->port_id */
12 u32 nport_id;
13 /* Binary World Wide unique Node Name for remote FC Initiator Nport */
14 u64 nport_wwnn;
15 /* ASCII formatted WWPN for FC Initiator Nport */
16 char nport_name[TCM_QLA2XXX_NAMELEN];
17 /* Pointer to qla_tgt_sess */
18 struct qla_tgt_sess *qla_tgt_sess;
19 /* Pointer to TCM FC nexus */
20 struct se_session *nport_nexus;
21 /* Returned by tcm_qla2xxx_make_nodeacl() */
22 struct se_node_acl se_node_acl;
23};
24
25struct 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;
Andy Groverde04a8a2013-07-19 15:06:38 -070030 int demo_mode_login_only;
Nicholas Bellinger75f8c1f2012-05-15 14:34:29 -040031};
32
33struct 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;
Nicholas Bellinger7474f522014-02-19 16:53:07 -080044 /* Items for dealing with configfs_depend_item */
45 struct completion tpg_base_comp;
46 struct work_struct tpg_base_work;
Nicholas Bellinger75f8c1f2012-05-15 14:34:29 -040047};
48
Nicholas Bellinger75f8c1f2012-05-15 14:34:29 -040049struct tcm_qla2xxx_fc_loopid {
50 struct se_node_acl *se_nacl;
51};
52
53struct tcm_qla2xxx_lport {
54 /* SCSI protocol the lport is providing */
55 u8 lport_proto_id;
56 /* Binary World Wide unique Port Name for FC Target Lport */
57 u64 lport_wwpn;
58 /* Binary World Wide unique Port Name for FC NPIV Target Lport */
59 u64 lport_npiv_wwpn;
60 /* Binary World Wide unique Node Name for FC NPIV Target Lport */
61 u64 lport_npiv_wwnn;
62 /* ASCII formatted WWPN for FC Target Lport */
63 char lport_name[TCM_QLA2XXX_NAMELEN];
Roland Dreierc046aa02012-10-11 13:41:31 -070064 /* ASCII formatted naa WWPN for VPD page 83 etc */
65 char lport_naa_name[TCM_QLA2XXX_NAMELEN];
Nicholas Bellinger75f8c1f2012-05-15 14:34:29 -040066 /* map for fc_port pointers in 24-bit FC Port ID space */
67 struct btree_head32 lport_fcport_map;
68 /* vmalloc-ed memory for fc_port pointers for 16-bit FC loop ID */
69 struct tcm_qla2xxx_fc_loopid *lport_loopid_map;
70 /* Pointer to struct scsi_qla_host from qla2xxx LLD */
71 struct scsi_qla_host *qla_vha;
Nicholas Bellinger75f8c1f2012-05-15 14:34:29 -040072 /* Pointer to struct qla_tgt pointer */
73 struct qla_tgt lport_qla_tgt;
Nicholas Bellinger75f8c1f2012-05-15 14:34:29 -040074 /* Pointer to TPG=1 for non NPIV mode */
75 struct tcm_qla2xxx_tpg *tpg_1;
76 /* Returned by tcm_qla2xxx_make_lport() */
77 struct se_wwn lport_wwn;
78};