23 #include <linux/export.h>
52 static ssize_t lio_target_np_show_sctp(
70 static ssize_t lio_target_np_store_sctp(
85 if ((op != 1) && (op != 0)) {
86 pr_err(
"Illegal value for tpg_enable: %u\n", op);
91 pr_err(
"Unable to locate struct iscsi_np from"
92 " struct iscsi_tpg_np\n");
106 if (!tpg_np_sctp || IS_ERR(tpg_np_sctp))
128 &lio_target_np_sctp.attr,
136 #define MAX_PORTAL_LEN 256
138 static struct se_tpg_np *lio_target_call_addnptotpg(
145 char *
str, *str2, *ip_str, *port_str;
154 pr_err(
"strlen(name): %d exceeds MAX_PORTAL_LEN: %d\n",
169 pr_err(
"Unable to locate trailing \"]\""
170 " in IPv6 iSCSI network portal address\n");
176 port_str =
strstr(str2,
":");
178 pr_err(
"Unable to locate \":port\""
179 " in IPv6 iSCSI network portal address\n");
187 pr_err(
"strict_strtoul() failed for port_str: %d\n", ret);
194 (
void *)&sock_in6->
sin6_addr.in6_u, -1, &end);
196 pr_err(
"in6_pton returned: %d\n", ret);
200 str = ip_str = &buf[0];
201 port_str =
strstr(ip_str,
":");
203 pr_err(
"Unable to locate \":port\""
204 " in IPv4 iSCSI network portal address\n");
212 pr_err(
"strict_strtoul() failed for port_str: %d\n", ret);
225 pr_debug(
"LIO_Target_ConfigFS: REGISTER -> %s TPGT: %hu"
227 config_item_name(&se_tpg->
se_tpg_wwn->wwn_group.cg_item),
244 if (IS_ERR(tpg_np)) {
246 return ERR_CAST(tpg_np);
248 pr_debug(
"LIO_Target_ConfigFS: addnptotpg done!\n");
254 static void lio_target_call_delnpfromtpg(
255 struct se_tpg_np *se_tpg_np)
269 pr_debug(
"LIO_Target_ConfigFS: DEREGISTER -> %s TPGT: %hu"
270 " PORTAL: %s:%hu\n", config_item_name(&se_tpg->
se_tpg_wwn->wwn_group.cg_item),
277 pr_debug(
"LIO_Target_ConfigFS: delnpfromtpg done!\n");
286 #define DEF_NACL_ATTRIB(name) \
287 static ssize_t iscsi_nacl_attrib_show_##name( \
288 struct se_node_acl *se_nacl, \
291 struct iscsi_node_acl *nacl = container_of(se_nacl, struct iscsi_node_acl, \
294 return sprintf(page, "%u\n", ISCSI_NODE_ATTRIB(nacl)->name); \
297 static ssize_t iscsi_nacl_attrib_store_##name( \
298 struct se_node_acl *se_nacl, \
302 struct iscsi_node_acl *nacl = container_of(se_nacl, struct iscsi_node_acl, \
308 val = simple_strtoul(page, &endptr, 0); \
309 ret = iscsit_na_##name(nacl, val); \
316 #define NACL_ATTR(_name, _mode) TF_NACL_ATTRIB_ATTR(iscsi, _name, _mode);
359 &iscsi_nacl_attrib_dataout_timeout.attr,
360 &iscsi_nacl_attrib_dataout_timeout_retries.attr,
361 &iscsi_nacl_attrib_default_erl.attr,
362 &iscsi_nacl_attrib_nopin_timeout.attr,
363 &iscsi_nacl_attrib_nopin_response_timeout.attr,
364 &iscsi_nacl_attrib_random_datain_pdu_offsets.attr,
365 &iscsi_nacl_attrib_random_datain_seq_offsets.attr,
366 &iscsi_nacl_attrib_random_r2t_offsets.attr,
374 #define __DEF_NACL_AUTH_STR(prefix, name, flags) \
375 static ssize_t __iscsi_##prefix##_show_##name( \
376 struct iscsi_node_acl *nacl, \
379 struct iscsi_node_auth *auth = &nacl->node_auth; \
381 if (!capable(CAP_SYS_ADMIN)) \
383 return snprintf(page, PAGE_SIZE, "%s\n", auth->name); \
386 static ssize_t __iscsi_##prefix##_store_##name( \
387 struct iscsi_node_acl *nacl, \
391 struct iscsi_node_auth *auth = &nacl->node_auth; \
393 if (!capable(CAP_SYS_ADMIN)) \
396 snprintf(auth->name, PAGE_SIZE, "%s", page); \
397 if (!strncmp("NULL", auth->name, 4)) \
398 auth->naf_flags &= ~flags; \
400 auth->naf_flags |= flags; \
402 if ((auth->naf_flags & NAF_USERID_IN_SET) && \
403 (auth->naf_flags & NAF_PASSWORD_IN_SET)) \
404 auth->authenticate_target = 1; \
406 auth->authenticate_target = 0; \
411 #define __DEF_NACL_AUTH_INT(prefix, name) \
412 static ssize_t __iscsi_##prefix##_show_##name( \
413 struct iscsi_node_acl *nacl, \
416 struct iscsi_node_auth *auth = &nacl->node_auth; \
418 if (!capable(CAP_SYS_ADMIN)) \
421 return snprintf(page, PAGE_SIZE, "%d\n", auth->name); \
424 #define DEF_NACL_AUTH_STR(name, flags) \
425 __DEF_NACL_AUTH_STR(nacl_auth, name, flags) \
426 static ssize_t iscsi_nacl_auth_show_##name( \
427 struct se_node_acl *nacl, \
430 return __iscsi_nacl_auth_show_##name(container_of(nacl, \
431 struct iscsi_node_acl, se_node_acl), page); \
433 static ssize_t iscsi_nacl_auth_store_##name( \
434 struct se_node_acl *nacl, \
438 return __iscsi_nacl_auth_store_##name(container_of(nacl, \
439 struct iscsi_node_acl, se_node_acl), page, count); \
442 #define DEF_NACL_AUTH_INT(name) \
443 __DEF_NACL_AUTH_INT(nacl_auth, name) \
444 static ssize_t iscsi_nacl_auth_show_##name( \
445 struct se_node_acl *nacl, \
448 return __iscsi_nacl_auth_show_##name(container_of(nacl, \
449 struct iscsi_node_acl, se_node_acl), page); \
452 #define AUTH_ATTR(_name, _mode) TF_NACL_AUTH_ATTR(iscsi, _name, _mode);
453 #define AUTH_ATTR_RO(_name) TF_NACL_AUTH_ATTR_RO(iscsi, _name);
482 &iscsi_nacl_auth_userid.attr,
483 &iscsi_nacl_auth_password.attr,
484 &iscsi_nacl_auth_authenticate_target.attr,
485 &iscsi_nacl_auth_userid_mutual.attr,
486 &iscsi_nacl_auth_password_mutual.attr,
494 #define DEF_NACL_PARAM(name) \
495 static ssize_t iscsi_nacl_param_show_##name( \
496 struct se_node_acl *se_nacl, \
499 struct iscsi_session *sess; \
500 struct se_session *se_sess; \
503 spin_lock_bh(&se_nacl->nacl_sess_lock); \
504 se_sess = se_nacl->nacl_sess; \
506 rb = snprintf(page, PAGE_SIZE, \
507 "No Active iSCSI Session\n"); \
509 sess = se_sess->fabric_sess_ptr; \
510 rb = snprintf(page, PAGE_SIZE, "%u\n", \
511 (u32)sess->sess_ops->name); \
513 spin_unlock_bh(&se_nacl->nacl_sess_lock); \
518 #define NACL_PARAM_ATTR(_name) TF_NACL_PARAM_ATTR_RO(iscsi, _name);
554 &iscsi_nacl_param_MaxConnections.attr,
555 &iscsi_nacl_param_InitialR2T.attr,
556 &iscsi_nacl_param_ImmediateData.attr,
557 &iscsi_nacl_param_MaxBurstLength.attr,
558 &iscsi_nacl_param_FirstBurstLength.attr,
559 &iscsi_nacl_param_DefaultTime2Wait.attr,
560 &iscsi_nacl_param_DefaultTime2Retain.attr,
561 &iscsi_nacl_param_MaxOutstandingR2T.attr,
562 &iscsi_nacl_param_DataPDUInOrder.attr,
563 &iscsi_nacl_param_DataSequenceInOrder.attr,
564 &iscsi_nacl_param_ErrorRecoveryLevel.attr,
572 static ssize_t lio_target_nacl_show_info(
584 rb +=
sprintf(page+rb,
"No active iSCSI Session for Initiator"
590 rb +=
sprintf(page+rb,
"InitiatorName: %s\n",
593 rb +=
sprintf(page+rb,
"InitiatorAlias: %s\n",
596 rb +=
sprintf(page+rb,
"LIO Session ID: %u "
597 "ISID: 0x%02x %02x %02x %02x %02x %02x "
598 "TSIH: %hu ", sess->
sid,
602 rb +=
sprintf(page+rb,
"SessionType: %s\n",
604 "Discovery" :
"Normal");
605 rb +=
sprintf(page+rb,
"Session State: ");
608 rb +=
sprintf(page+rb,
"TARG_SESS_FREE\n");
611 rb +=
sprintf(page+rb,
"TARG_SESS_STATE_ACTIVE\n");
614 rb +=
sprintf(page+rb,
"TARG_SESS_STATE_LOGGED_IN\n");
617 rb +=
sprintf(page+rb,
"TARG_SESS_STATE_FAILED\n");
620 rb +=
sprintf(page+rb,
"TARG_SESS_STATE_IN_CONTINUE\n");
623 rb +=
sprintf(page+rb,
"ERROR: Unknown Session"
628 rb +=
sprintf(page+rb,
"---------------------[iSCSI Session"
629 " Values]-----------------------\n");
630 rb +=
sprintf(page+rb,
" CmdSN/WR : CmdSN/WC : ExpCmdSN"
631 " : MaxCmdSN : ITT : TTT\n");
632 rb +=
sprintf(page+rb,
" 0x%08x 0x%08x 0x%08x 0x%08x"
638 rb +=
sprintf(page+rb,
"----------------------[iSCSI"
639 " Connections]-------------------------\n");
643 rb +=
sprintf(page+rb,
"CID: %hu Connection"
644 " State: ", conn->
cid);
648 "TARG_CONN_STATE_FREE\n");
652 "TARG_CONN_STATE_XPT_UP\n");
656 "TARG_CONN_STATE_IN_LOGIN\n");
660 "TARG_CONN_STATE_LOGGED_IN\n");
664 "TARG_CONN_STATE_IN_LOGOUT\n");
668 "TARG_CONN_STATE_LOGOUT_REQUESTED\n");
672 "TARG_CONN_STATE_CLEANUP_WAIT\n");
676 "ERROR: Unknown Connection State!\n");
683 rb +=
sprintf(page+rb,
" StatSN: 0x%08x\n",
695 static ssize_t lio_target_nacl_show_cmdsn_depth(
702 static ssize_t lio_target_nacl_store_cmdsn_depth(
717 pr_err(
"Passed cmdsn_depth: %u exceeds"
718 " TA_DEFAULT_CMDSN_DEPTH_MAX: %u\n", cmdsn_depth,
724 pr_err(
"Unable to locatel acl_ci\n");
727 tpg_ci = &acl_ci->
ci_parent->ci_group->cg_item;
729 pr_err(
"Unable to locate tpg_ci\n");
732 wwn_ci = &tpg_ci->
ci_group->cg_item;
734 pr_err(
"Unable to locate config_item wwn_ci\n");
744 config_item_name(acl_ci), cmdsn_depth, 1);
746 pr_debug(
"LIO_Target_ConfigFS: %s/%s Set CmdSN Window: %u for"
747 "InitiatorName: %s\n", config_item_name(wwn_ci),
748 config_item_name(tpg_ci), cmdsn_depth,
749 config_item_name(acl_ci));
752 return (!ret) ? count : (
ssize_t)ret;
758 &lio_target_nacl_info.attr,
759 &lio_target_nacl_cmdsn_depth.attr,
763 static struct se_node_acl *lio_tpg_alloc_fabric_acl(
770 pr_err(
"Unable to allocate memory for struct iscsi_node_acl\n");
777 static struct se_node_acl *lio_target_make_nodeacl(
789 se_nacl_new = lio_tpg_alloc_fabric_acl(se_tpg);
809 pr_err(
"Unable to allocate memory for"
810 " stats_cg->default_groups\n");
824 static void lio_target_drop_nodeacl(
834 stats_cg = &acl->
se_node_acl.acl_fabric_stat_group;
850 #define DEF_TPG_ATTRIB(name) \
852 static ssize_t iscsi_tpg_attrib_show_##name( \
853 struct se_portal_group *se_tpg, \
856 struct iscsi_portal_group *tpg = container_of(se_tpg, \
857 struct iscsi_portal_group, tpg_se_tpg); \
860 if (iscsit_get_tpg(tpg) < 0) \
863 rb = sprintf(page, "%u\n", ISCSI_TPG_ATTRIB(tpg)->name); \
864 iscsit_put_tpg(tpg); \
868 static ssize_t iscsi_tpg_attrib_store_##name( \
869 struct se_portal_group *se_tpg, \
873 struct iscsi_portal_group *tpg = container_of(se_tpg, \
874 struct iscsi_portal_group, tpg_se_tpg); \
879 if (iscsit_get_tpg(tpg) < 0) \
882 val = simple_strtoul(page, &endptr, 0); \
883 ret = iscsit_ta_##name(tpg, val); \
887 iscsit_put_tpg(tpg); \
890 iscsit_put_tpg(tpg); \
894 #define TPG_ATTR(_name, _mode) TF_TPG_ATTRIB_ATTR(iscsi, _name, _mode);
938 &iscsi_tpg_attrib_authentication.attr,
939 &iscsi_tpg_attrib_login_timeout.attr,
940 &iscsi_tpg_attrib_netif_timeout.attr,
941 &iscsi_tpg_attrib_generate_node_acls.attr,
942 &iscsi_tpg_attrib_default_cmdsn_depth.attr,
943 &iscsi_tpg_attrib_cache_dynamic_acls.attr,
944 &iscsi_tpg_attrib_demo_mode_write_protect.attr,
945 &iscsi_tpg_attrib_prod_mode_write_protect.attr,
953 #define DEF_TPG_PARAM(name) \
954 static ssize_t iscsi_tpg_param_show_##name( \
955 struct se_portal_group *se_tpg, \
958 struct iscsi_portal_group *tpg = container_of(se_tpg, \
959 struct iscsi_portal_group, tpg_se_tpg); \
960 struct iscsi_param *param; \
963 if (iscsit_get_tpg(tpg) < 0) \
966 param = iscsi_find_param_from_key(__stringify(name), \
969 iscsit_put_tpg(tpg); \
972 rb = snprintf(page, PAGE_SIZE, "%s\n", param->value); \
974 iscsit_put_tpg(tpg); \
977 static ssize_t iscsi_tpg_param_store_##name( \
978 struct se_portal_group *se_tpg, \
982 struct iscsi_portal_group *tpg = container_of(se_tpg, \
983 struct iscsi_portal_group, tpg_se_tpg); \
987 buf = kzalloc(PAGE_SIZE, GFP_KERNEL); \
990 snprintf(buf, PAGE_SIZE, "%s=%s", __stringify(name), page); \
991 buf[strlen(buf)-1] = '\0'; \
993 if (iscsit_get_tpg(tpg) < 0) { \
998 ret = iscsi_change_param_value(buf, tpg->param_list, 1); \
1003 iscsit_put_tpg(tpg); \
1007 iscsit_put_tpg(tpg); \
1011 #define TPG_PARAM_ATTR(_name, _mode) TF_TPG_PARAM_ATTR(iscsi, _name, _mode);
1077 &iscsi_tpg_param_AuthMethod.attr,
1078 &iscsi_tpg_param_HeaderDigest.attr,
1079 &iscsi_tpg_param_DataDigest.attr,
1080 &iscsi_tpg_param_MaxConnections.attr,
1081 &iscsi_tpg_param_TargetAlias.attr,
1082 &iscsi_tpg_param_InitialR2T.attr,
1083 &iscsi_tpg_param_ImmediateData.attr,
1084 &iscsi_tpg_param_MaxRecvDataSegmentLength.attr,
1085 &iscsi_tpg_param_MaxXmitDataSegmentLength.attr,
1086 &iscsi_tpg_param_MaxBurstLength.attr,
1087 &iscsi_tpg_param_FirstBurstLength.attr,
1088 &iscsi_tpg_param_DefaultTime2Wait.attr,
1089 &iscsi_tpg_param_DefaultTime2Retain.attr,
1090 &iscsi_tpg_param_MaxOutstandingR2T.attr,
1091 &iscsi_tpg_param_DataPDUInOrder.attr,
1092 &iscsi_tpg_param_DataSequenceInOrder.attr,
1093 &iscsi_tpg_param_ErrorRecoveryLevel.attr,
1094 &iscsi_tpg_param_IFMarker.attr,
1095 &iscsi_tpg_param_OFMarker.attr,
1096 &iscsi_tpg_param_IFMarkInt.attr,
1097 &iscsi_tpg_param_OFMarkInt.attr,
1105 static ssize_t lio_target_tpg_show_enable(
1121 static ssize_t lio_target_tpg_store_enable(
1133 if ((op != 1) && (op != 0)) {
1134 pr_err(
"Illegal value for tpg_enable: %u\n", op);
1165 &lio_target_tpg_enable.attr,
1180 char *tpgt_str, *end_ptr;
1182 unsigned short int tpgt;
1189 tpgt_str =
strstr(name,
"tpgt_");
1191 pr_err(
"Unable to locate \"tpgt_#\" directory"
1203 &lio_target_fabric_configfs->
tf_ops,
1213 pr_debug(
"LIO_Target_ConfigFS: REGISTER -> %s\n", tiqn->
tiqn);
1214 pr_debug(
"LIO_Target_ConfigFS: REGISTER -> Allocated TPG: %s\n",
1233 pr_debug(
"LIO_Target_ConfigFS: DEREGISTER -> Releasing TPG\n");
1241 static ssize_t lio_target_wwn_show_attr_lio_version(
1251 &lio_target_wwn_lio_version.attr,
1255 static struct se_wwn *lio_target_call_coreaddtiqn(
1265 return ERR_CAST(tiqn);
1269 stats_cg = &tiqn->
tiqn_wwn.fabric_stat_group;
1274 pr_err(
"Unable to allocate memory for"
1275 " stats_cg->default_groups\n");
1297 pr_debug(
"LIO_Target_ConfigFS: REGISTER -> %s\n", tiqn->
tiqn);
1298 pr_debug(
"LIO_Target_ConfigFS: REGISTER -> Allocated Node:"
1303 static void lio_target_call_coredeltiqn(
1311 stats_cg = &tiqn->
tiqn_wwn.fabric_stat_group;
1319 pr_debug(
"LIO_Target_ConfigFS: DEREGISTER -> %s\n",
1328 #define DEF_DISC_AUTH_STR(name, flags) \
1329 __DEF_NACL_AUTH_STR(disc, name, flags) \
1330 static ssize_t iscsi_disc_show_##name( \
1331 struct target_fabric_configfs *tf, \
1334 return __iscsi_disc_show_##name(&iscsit_global->discovery_acl, \
1337 static ssize_t iscsi_disc_store_##name( \
1338 struct target_fabric_configfs *tf, \
1342 return __iscsi_disc_store_##name(&iscsit_global->discovery_acl, \
1346 #define DEF_DISC_AUTH_INT(name) \
1347 __DEF_NACL_AUTH_INT(disc, name) \
1348 static ssize_t iscsi_disc_show_##name( \
1349 struct target_fabric_configfs *tf, \
1352 return __iscsi_disc_show_##name(&iscsit_global->discovery_acl, \
1356 #define DISC_AUTH_ATTR(_name, _mode) TF_DISC_ATTR(iscsi, _name, _mode)
1357 #define DISC_AUTH_ATTR_RO(_name) TF_DISC_ATTR_RO(iscsi, _name)
1388 static ssize_t iscsi_disc_show_enforce_discovery_auth(
1397 static ssize_t iscsi_disc_store_enforce_discovery_auth(
1408 if ((op != 1) && (op != 0)) {
1409 pr_err(
"Illegal value for enforce_discovery_auth:"
1414 if (!discovery_tpg) {
1415 pr_err(
"iscsit_global->discovery_tpg is NULL\n");
1431 discovery_tpg->
tpg_attrib.authentication = 1;
1433 pr_debug(
"LIO-CORE[0] Successfully enabled"
1434 " authentication enforcement for iSCSI"
1435 " Discovery TPG\n");
1443 discovery_tpg->
tpg_attrib.authentication = 0;
1445 pr_debug(
"LIO-CORE[0] Successfully disabled"
1446 " authentication enforcement for iSCSI"
1447 " Discovery TPG\n");
1456 &iscsi_disc_userid.attr,
1457 &iscsi_disc_password.attr,
1458 &iscsi_disc_authenticate_target.attr,
1459 &iscsi_disc_userid_mutual.attr,
1460 &iscsi_disc_password_mutual.attr,
1461 &iscsi_disc_enforce_discovery_auth.attr,
1469 static char *iscsi_get_fabric_name(
void)
1482 static int iscsi_get_cmd_state(
struct se_cmd *se_cmd)
1496 static u32 lio_sess_get_initiator_sid(
1505 return snprintf(buf, size,
"%02x%02x%02x%02x%02x%02x",
1510 static int lio_queue_data_in(
struct se_cmd *se_cmd)
1519 static int lio_write_pending(
struct se_cmd *se_cmd)
1529 static int lio_write_pending_status(
struct se_cmd *se_cmd)
1541 static int lio_queue_status(
struct se_cmd *se_cmd)
1550 static int lio_queue_tm_rsp(
struct se_cmd *se_cmd)
1587 static int lio_tpg_check_demo_mode_cache(
struct se_portal_group *se_tpg)
1594 static int lio_tpg_check_demo_mode_write_protect(
1602 static int lio_tpg_check_prod_mode_write_protect(
1610 static void lio_tpg_release_fabric_acl(
1625 static int lio_tpg_shutdown_session(
struct se_session *se_sess)
1649 static void lio_tpg_close_session(
struct se_session *se_sess)
1666 static void lio_set_default_node_attributes(
struct se_node_acl *se_acl)
1675 static void lio_release_cmd(
struct se_cmd *se_cmd)
1689 lio_target_fabric_configfs =
NULL;
1691 if (IS_ERR(fabric)) {
1692 pr_err(
"target_fabric_configfs_init() for"
1693 " LIO-Target failed!\n");
1694 return PTR_ERR(fabric);
1699 fabric->
tf_ops.get_fabric_name = &iscsi_get_fabric_name;
1701 fabric->
tf_ops.tpg_get_wwn = &lio_tpg_get_endpoint_wwn;
1702 fabric->
tf_ops.tpg_get_tag = &lio_tpg_get_tag;
1703 fabric->
tf_ops.tpg_get_default_depth = &lio_tpg_get_default_depth;
1705 fabric->
tf_ops.tpg_get_pr_transport_id_len =
1707 fabric->
tf_ops.tpg_parse_pr_out_transport_id =
1709 fabric->
tf_ops.tpg_check_demo_mode = &lio_tpg_check_demo_mode;
1710 fabric->
tf_ops.tpg_check_demo_mode_cache =
1711 &lio_tpg_check_demo_mode_cache;
1712 fabric->
tf_ops.tpg_check_demo_mode_write_protect =
1713 &lio_tpg_check_demo_mode_write_protect;
1714 fabric->
tf_ops.tpg_check_prod_mode_write_protect =
1715 &lio_tpg_check_prod_mode_write_protect;
1716 fabric->
tf_ops.tpg_alloc_fabric_acl = &lio_tpg_alloc_fabric_acl;
1717 fabric->
tf_ops.tpg_release_fabric_acl = &lio_tpg_release_fabric_acl;
1718 fabric->
tf_ops.tpg_get_inst_index = &lio_tpg_get_inst_index;
1719 fabric->
tf_ops.release_cmd = &lio_release_cmd;
1720 fabric->
tf_ops.shutdown_session = &lio_tpg_shutdown_session;
1721 fabric->
tf_ops.close_session = &lio_tpg_close_session;
1722 fabric->
tf_ops.sess_get_index = &lio_sess_get_index;
1723 fabric->
tf_ops.sess_get_initiator_sid = &lio_sess_get_initiator_sid;
1724 fabric->
tf_ops.write_pending = &lio_write_pending;
1725 fabric->
tf_ops.write_pending_status = &lio_write_pending_status;
1726 fabric->
tf_ops.set_default_node_attributes =
1727 &lio_set_default_node_attributes;
1728 fabric->
tf_ops.get_task_tag = &iscsi_get_task_tag;
1729 fabric->
tf_ops.get_cmd_state = &iscsi_get_cmd_state;
1730 fabric->
tf_ops.queue_data_in = &lio_queue_data_in;
1731 fabric->
tf_ops.queue_status = &lio_queue_status;
1732 fabric->
tf_ops.queue_tm_rsp = &lio_queue_tm_rsp;
1736 fabric->
tf_ops.fabric_make_wwn = &lio_target_call_coreaddtiqn;
1737 fabric->
tf_ops.fabric_drop_wwn = &lio_target_call_coredeltiqn;
1738 fabric->
tf_ops.fabric_make_tpg = &lio_target_tiqn_addtpg;
1739 fabric->
tf_ops.fabric_drop_tpg = &lio_target_tiqn_deltpg;
1742 fabric->
tf_ops.fabric_make_np = &lio_target_call_addnptotpg;
1743 fabric->
tf_ops.fabric_drop_np = &lio_target_call_delnpfromtpg;
1744 fabric->
tf_ops.fabric_make_nodeacl = &lio_target_make_nodeacl;
1745 fabric->
tf_ops.fabric_drop_nodeacl = &lio_target_drop_nodeacl;
1750 TF_CIT_TMPL(fabric)->tfc_discovery_cit.ct_attrs = lio_target_discovery_auth_attrs;
1751 TF_CIT_TMPL(fabric)->tfc_wwn_cit.ct_attrs = lio_target_wwn_attrs;
1752 TF_CIT_TMPL(fabric)->tfc_tpg_base_cit.ct_attrs = lio_target_tpg_attrs;
1753 TF_CIT_TMPL(fabric)->tfc_tpg_attrib_cit.ct_attrs = lio_target_tpg_attrib_attrs;
1754 TF_CIT_TMPL(fabric)->tfc_tpg_param_cit.ct_attrs = lio_target_tpg_param_attrs;
1755 TF_CIT_TMPL(fabric)->tfc_tpg_np_base_cit.ct_attrs = lio_target_portal_attrs;
1756 TF_CIT_TMPL(fabric)->tfc_tpg_nacl_base_cit.ct_attrs = lio_target_initiator_attrs;
1757 TF_CIT_TMPL(fabric)->tfc_tpg_nacl_attrib_cit.ct_attrs = lio_target_nacl_attrib_attrs;
1758 TF_CIT_TMPL(fabric)->tfc_tpg_nacl_auth_cit.ct_attrs = lio_target_nacl_auth_attrs;
1759 TF_CIT_TMPL(fabric)->tfc_tpg_nacl_param_cit.ct_attrs = lio_target_nacl_param_attrs;
1763 pr_err(
"target_fabric_configfs_register() for"
1764 " LIO-Target failed!\n");
1769 lio_target_fabric_configfs = fabric;
1770 pr_debug(
"LIO_TARGET[0] - Set fabric ->"
1771 " lio_target_fabric_configfs\n");
1778 if (!lio_target_fabric_configfs)
1787 lio_target_fabric_configfs =
NULL;
1789 " lio_target_fabric_configfs\n");