target: header reshuffle, part2
authorChristoph Hellwig <hch@infradead.org>
Wed, 16 Nov 2011 14:46:48 +0000 (09:46 -0500)
committerNicholas Bellinger <nab@linux-iscsi.org>
Wed, 14 Dec 2011 11:26:05 +0000 (11:26 +0000)
This reorganized the headers under include/target into:

 - target_core_base.h stays as is with all target-wide data stuctures and defines
 - target_core_backend.h contains the whole interface to I/O backends
 - target_core_fabric.h contains the whole interface to fabric modules

Except for those only the various configfs macro headers stay around.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
45 files changed:
Documentation/target/tcm_mod_builder.py
drivers/target/iscsi/iscsi_target.c
drivers/target/iscsi/iscsi_target_configfs.c
drivers/target/iscsi/iscsi_target_device.c
drivers/target/iscsi/iscsi_target_erl0.c
drivers/target/iscsi/iscsi_target_erl1.c
drivers/target/iscsi/iscsi_target_erl2.c
drivers/target/iscsi/iscsi_target_login.c
drivers/target/iscsi/iscsi_target_nego.c
drivers/target/iscsi/iscsi_target_nodeattrib.c
drivers/target/iscsi/iscsi_target_stat.c
drivers/target/iscsi/iscsi_target_tmr.c
drivers/target/iscsi/iscsi_target_tpg.c
drivers/target/iscsi/iscsi_target_util.c
drivers/target/loopback/tcm_loop.c
drivers/target/target_core_alua.c
drivers/target/target_core_cdb.c
drivers/target/target_core_configfs.c
drivers/target/target_core_device.c
drivers/target/target_core_fabric_configfs.c
drivers/target/target_core_fabric_lib.c
drivers/target/target_core_file.c
drivers/target/target_core_hba.c
drivers/target/target_core_iblock.c
drivers/target/target_core_pr.c
drivers/target/target_core_pscsi.c
drivers/target/target_core_rd.c
drivers/target/target_core_stat.c
drivers/target/target_core_tmr.c
drivers/target/target_core_tpg.c
drivers/target/target_core_transport.c
drivers/target/target_core_ua.c
drivers/target/tcm_fc/tfc_cmd.c
drivers/target/tcm_fc/tfc_conf.c
drivers/target/tcm_fc/tfc_io.c
drivers/target/tcm_fc/tfc_sess.c
include/target/target_core_backend.h [new file with mode: 0644]
include/target/target_core_base.h
include/target/target_core_device.h [deleted file]
include/target/target_core_fabric.h [new file with mode: 0644]
include/target/target_core_fabric_lib.h [deleted file]
include/target/target_core_fabric_ops.h [deleted file]
include/target/target_core_tmr.h [deleted file]
include/target/target_core_tpg.h [deleted file]
include/target/target_core_transport.h [deleted file]

index 7ef9b843d529a5fadbe05eb19ad6c34fd8293cd5..e2abb29fb9937635e17ca7afebb5fffcf2312a23 100755 (executable)
@@ -230,14 +230,9 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
        buf += "#include <linux/ctype.h>\n"
        buf += "#include <asm/unaligned.h>\n\n"
        buf += "#include <target/target_core_base.h>\n"
-       buf += "#include <target/target_core_transport.h>\n"
-       buf += "#include <target/target_core_fabric_ops.h>\n"
+       buf += "#include <target/target_core_fabric.h>\n"
        buf += "#include <target/target_core_fabric_configfs.h>\n"
-       buf += "#include <target/target_core_fabric_lib.h>\n"
-       buf += "#include <target/target_core_device.h>\n"
-       buf += "#include <target/target_core_tpg.h>\n"
        buf += "#include <target/target_core_configfs.h>\n"
-       buf += "#include <target/target_core_base.h>\n"
        buf += "#include <target/configfs_macros.h>\n\n"
        buf += "#include \"" + fabric_mod_name + "_base.h\"\n"
        buf += "#include \"" + fabric_mod_name + "_fabric.h\"\n\n"
@@ -514,7 +509,7 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
 
 def tcm_mod_scan_fabric_ops(tcm_dir):
 
-       fabric_ops_api = tcm_dir + "include/target/target_core_fabric_ops.h"
+       fabric_ops_api = tcm_dir + "include/target/target_core_fabric.h"
 
        print "Using tcm_mod_scan_fabric_ops: " + fabric_ops_api
        process_fo = 0;
@@ -579,11 +574,7 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name):
        buf += "#include <scsi/scsi_cmnd.h>\n"
        buf += "#include <scsi/libfc.h>\n\n"
        buf += "#include <target/target_core_base.h>\n"
-       buf += "#include <target/target_core_transport.h>\n"
-       buf += "#include <target/target_core_fabric_ops.h>\n"
-       buf += "#include <target/target_core_fabric_lib.h>\n"
-       buf += "#include <target/target_core_device.h>\n"
-       buf += "#include <target/target_core_tpg.h>\n"
+       buf += "#include <target/target_core_fabric.h>\n"
        buf += "#include <target/target_core_configfs.h>\n\n"
        buf += "#include \"" + fabric_mod_name + "_base.h\"\n"
        buf += "#include \"" + fabric_mod_name + "_fabric.h\"\n\n"
index 8599545cdf9e6d6c90a07510844f6290ab0a1be6..f74a62d46eea8a47cdd36544f741094f0c44c077 100644 (file)
@@ -27,8 +27,7 @@
 #include <scsi/scsi_device.h>
 #include <scsi/iscsi_proto.h>
 #include <target/target_core_base.h>
-#include <target/target_core_tmr.h>
-#include <target/target_core_transport.h>
+#include <target/target_core_fabric.h>
 
 #include "iscsi_target_core.h"
 #include "iscsi_target_parameters.h"
index db327845e46b46fc04d6f2be7a21d68d9aa53d53..c04d389a2ff211d14c94eb1325a5463a2c114740 100644 (file)
 #include <linux/configfs.h>
 #include <linux/export.h>
 #include <target/target_core_base.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
+#include <target/target_core_fabric.h>
 #include <target/target_core_fabric_configfs.h>
-#include <target/target_core_fabric_lib.h>
-#include <target/target_core_device.h>
-#include <target/target_core_tpg.h>
 #include <target/target_core_configfs.h>
 #include <target/configfs_macros.h>
 
index a19fa5eea88e8edcd3db9ab57bc399ad150dd15d..f63ea35bc4ae7737c7ad16b443b2a6ea9c017e2e 100644 (file)
@@ -21,8 +21,7 @@
 
 #include <scsi/scsi_device.h>
 #include <target/target_core_base.h>
-#include <target/target_core_device.h>
-#include <target/target_core_transport.h>
+#include <target/target_core_fabric.h>
 
 #include "iscsi_target_core.h"
 #include "iscsi_target_device.h"
index b7ffc3cd40cca0141ac02441894a1bd018fc2f0e..478451167b62b4c1b3b443e08b1bb6c06ff10cad 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <scsi/iscsi_proto.h>
 #include <target/target_core_base.h>
-#include <target/target_core_transport.h>
+#include <target/target_core_fabric.h>
 
 #include "iscsi_target_core.h"
 #include "iscsi_target_seq_pdu_list.h"
index 101b1beb3bca205aed7611ec4424f54cc5b20671..255c0d67e8983d00894e8a348f84d7dffc0367db 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/list.h>
 #include <scsi/iscsi_proto.h>
 #include <target/target_core_base.h>
-#include <target/target_core_transport.h>
+#include <target/target_core_fabric.h>
 
 #include "iscsi_target_core.h"
 #include "iscsi_target_seq_pdu_list.h"
index 0b8404c30125256a99bff82082516c324ff16364..1af1f21af21fd01735eab9cec3f2369246e69bd4 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <scsi/iscsi_proto.h>
 #include <target/target_core_base.h>
-#include <target/target_core_transport.h>
+#include <target/target_core_fabric.h>
 
 #include "iscsi_target_core.h"
 #include "iscsi_target_datain_values.h"
index d734bdec24f9cf2b451a7f905b07fab421a19b3b..d74e278ec8f7729a49bc45a7b6ecd2530d2000be 100644 (file)
@@ -23,7 +23,7 @@
 #include <linux/crypto.h>
 #include <scsi/iscsi_proto.h>
 #include <target/target_core_base.h>
-#include <target/target_core_transport.h>
+#include <target/target_core_fabric.h>
 
 #include "iscsi_target_core.h"
 #include "iscsi_target_tq.h"
index 98936cb7c2947ceb0edbaa41dda91d6641a9b892..53eea5c827f0e0c00b539b0eb21116292f395946 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/ctype.h>
 #include <scsi/iscsi_proto.h>
 #include <target/target_core_base.h>
-#include <target/target_core_tpg.h>
+#include <target/target_core_fabric.h>
 
 #include "iscsi_target_core.h"
 #include "iscsi_target_parameters.h"
index aeafbe0cd7d11b294053f1424e5d91cb3c7336ac..ac047d8a7a136cb55d19f0a10c3ecf3b25e3bcd0 100644 (file)
@@ -19,7 +19,6 @@
  ******************************************************************************/
 
 #include <target/target_core_base.h>
-#include <target/target_core_transport.h>
 
 #include "iscsi_target_core.h"
 #include "iscsi_target_device.h"
index f1db83077e0a8418d448a7d9b210cc63014b1d3c..5a1aac0ec7de8cf0d3f2812609660669db288ecc 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/export.h>
 #include <scsi/iscsi_proto.h>
 #include <target/target_core_base.h>
-#include <target/target_core_transport.h>
 #include <target/configfs_macros.h>
 
 #include "iscsi_target_core.h"
index 490207eacde976a179f1197d21f3901afd1c78e0..255ed35da815e3059c1930683255575b51ff58d7 100644 (file)
@@ -21,7 +21,7 @@
 #include <asm/unaligned.h>
 #include <scsi/iscsi_proto.h>
 #include <target/target_core_base.h>
-#include <target/target_core_transport.h>
+#include <target/target_core_fabric.h>
 
 #include "iscsi_target_core.h"
 #include "iscsi_target_seq_pdu_list.h"
index d4cf2cd25c447f8ac109f7dcdc20fca572d96abc..cfbcf6e4877d876cf779b5809614ecad89215b6a 100644 (file)
  ******************************************************************************/
 
 #include <target/target_core_base.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
+#include <target/target_core_fabric.h>
 #include <target/target_core_configfs.h>
-#include <target/target_core_tpg.h>
 
 #include "iscsi_target_core.h"
 #include "iscsi_target_erl0.h"
index 02348f727bd4ddaaa4ef4b70e3499fc135001dad..c1daea1908590ad4f6635c98d50af0315c389b47 100644 (file)
@@ -22,9 +22,7 @@
 #include <scsi/scsi_tcq.h>
 #include <scsi/iscsi_proto.h>
 #include <target/target_core_base.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_tmr.h>
-#include <target/target_core_fabric_ops.h>
+#include <target/target_core_fabric.h>
 #include <target/target_core_configfs.h>
 
 #include "iscsi_target_core.h"
index 81d5832fbbd537e7bbffe2c21b1792c1e7a2acde..d427a290e18489d29966a8fa6ec920c9e291b257 100644 (file)
 #include <scsi/scsi_cmnd.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
+#include <target/target_core_fabric.h>
 #include <target/target_core_fabric_configfs.h>
-#include <target/target_core_fabric_lib.h>
 #include <target/target_core_configfs.h>
-#include <target/target_core_device.h>
-#include <target/target_core_tpg.h>
-#include <target/target_core_tmr.h>
 
 #include "tcm_loop.h"
 
index 097eb5a49648ede2c35c88c20849fb7f00e9e82f..1b1edd14f4bff4629427725a19239508d8ee2279 100644 (file)
@@ -32,9 +32,8 @@
 #include <scsi/scsi_cmnd.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_device.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
+#include <target/target_core_backend.h>
+#include <target/target_core_fabric.h>
 #include <target/target_core_configfs.h>
 
 #include "target_core_internal.h"
index 8f2934fcc68ccccf0aaba3fae06e1fba208c1e00..59219509d886b08de74fb96ed8e208e218c11924 100644 (file)
@@ -29,8 +29,8 @@
 #include <scsi/scsi.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
+#include <target/target_core_backend.h>
+#include <target/target_core_fabric.h>
 
 #include "target_core_internal.h"
 #include "target_core_ua.h"
index ac55af56ba121374fab5231c177afe54dfb5b76e..3c358907a4a63962bf5a0998a61e6ff7505838e5 100644 (file)
@@ -39,9 +39,8 @@
 #include <linux/spinlock.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_device.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
+#include <target/target_core_backend.h>
+#include <target/target_core_fabric.h>
 #include <target/target_core_fabric_configfs.h>
 #include <target/target_core_configfs.h>
 #include <target/configfs_macros.h>
index 28ffe0b52bde1f7bd70e7ab61677f164b8511ba6..1f74de25a92fe854e855fc2291540e8875686799 100644 (file)
 #include <scsi/scsi_device.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_device.h>
-#include <target/target_core_tpg.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
+#include <target/target_core_backend.h>
+#include <target/target_core_fabric.h>
 
 #include "target_core_internal.h"
 #include "target_core_alua.h"
index fa1e4eb01bc7f6ce9386bee51561673962b8bdab..4f77cce22646df958e05c7cf66d37be813f4757f 100644 (file)
 #include <linux/configfs.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_device.h>
-#include <target/target_core_tpg.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
+#include <target/target_core_fabric.h>
 #include <target/target_core_fabric_configfs.h>
 #include <target/target_core_configfs.h>
 #include <target/configfs_macros.h>
index dd9ae929dda2d4e7c15482d07b8144f839aff394..32d7feb405ece1b93b4311bbc2087bed6b0c5869 100644 (file)
 #include <scsi/scsi_cmnd.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_device.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_lib.h>
-#include <target/target_core_fabric_ops.h>
+#include <target/target_core_fabric.h>
 #include <target/target_core_configfs.h>
 
 #include "target_core_internal.h"
index b4864fba4ef0d511758916a8debac60ee9f43674..ed7e05353d6215f8f2939bb02834074b40d15bca 100644 (file)
@@ -37,8 +37,7 @@
 #include <scsi/scsi_host.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_device.h>
-#include <target/target_core_transport.h>
+#include <target/target_core_backend.h>
 
 #include "target_core_file.h"
 
index 26c1238976cbb631a87524c07672e076896e4266..3dd1bd4b6f71c712eb10770ebf976a9a7fa67cfc 100644 (file)
@@ -37,9 +37,8 @@
 #include <net/tcp.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_device.h>
-#include <target/target_core_tpg.h>
-#include <target/target_core_transport.h>
+#include <target/target_core_backend.h>
+#include <target/target_core_fabric.h>
 
 #include "target_core_internal.h"
 
index 4aa9922044382628fc21e12d8df3ab67840c23ae..feebbfe6cbd0936defeaeb927d2aca36c095b2ba 100644 (file)
@@ -42,8 +42,7 @@
 #include <scsi/scsi_host.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_device.h>
-#include <target/target_core_transport.h>
+#include <target/target_core_backend.h>
 
 #include "target_core_iblock.h"
 
index 36fa9a5f1ba6e226ef1441b13f442fa7a57501a1..d2b73b3f4e6c6972532e941c967da4d601c83577 100644 (file)
 #include <asm/unaligned.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_device.h>
-#include <target/target_core_tmr.h>
-#include <target/target_core_tpg.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
+#include <target/target_core_backend.h>
+#include <target/target_core_fabric.h>
 #include <target/target_core_configfs.h>
 
 #include "target_core_internal.h"
index 8b15e56b038461169872d964055316c0318e7e31..5d8851de3aee73f2b45f5da6965917276b03d475 100644 (file)
@@ -44,8 +44,7 @@
 #include <scsi/scsi_tcq.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_device.h>
-#include <target/target_core_transport.h>
+#include <target/target_core_backend.h>
 
 #include "target_core_pscsi.h"
 
index 02e51faa2f4ea168f0a6139c8e303fc9fca81c28..94b4087dadd539a07b06a9a9fbf721c213fbea35 100644 (file)
@@ -37,9 +37,7 @@
 #include <scsi/scsi_host.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_device.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
+#include <target/target_core_backend.h>
 
 #include "target_core_rd.h"
 
index d2ba9266ff4d555646e84d868f8fd816d66ecae6..6d8a90464f2e20da18a6c049e610bb7dd19e6ba7 100644 (file)
@@ -43,8 +43,8 @@
 #include <scsi/scsi_host.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
+#include <target/target_core_backend.h>
+#include <target/target_core_fabric.h>
 #include <target/target_core_configfs.h>
 #include <target/configfs_macros.h>
 
index 47bc26ba7865a0cb1849047a31eb38e33ce51f36..fc9d748903194d0cd1b99350f306f6dc51e903b9 100644 (file)
 #include <scsi/scsi_cmnd.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_device.h>
-#include <target/target_core_tmr.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
+#include <target/target_core_backend.h>
+#include <target/target_core_fabric.h>
 #include <target/target_core_configfs.h>
 
 #include "target_core_internal.h"
index 0a936fae3d23a3c83df37cd8f271b1e51daa24d4..b7668029bb311d77820613bdaf2b5b0c0ba04d28 100644 (file)
 #include <scsi/scsi_cmnd.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_device.h>
-#include <target/target_core_tpg.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
+#include <target/target_core_backend.h>
+#include <target/target_core_fabric.h>
 
 #include "target_core_internal.h"
 
index e0ea63dedde307c787eca8acf41a56db70025d13..72c13b7a349f95bbccc2cd113ee982d8952c97fe 100644 (file)
 #include <scsi/scsi_tcq.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_device.h>
-#include <target/target_core_tmr.h>
-#include <target/target_core_tpg.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
+#include <target/target_core_backend.h>
+#include <target/target_core_fabric.h>
 #include <target/target_core_configfs.h>
 
 #include "target_core_internal.h"
index e2ae53c7e088f11d92b48ca76fca6c4528094f69..3e12f6bcfa10ba6d502aab352a6ea474839a1dd0 100644 (file)
@@ -30,9 +30,7 @@
 #include <scsi/scsi_cmnd.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_device.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
+#include <target/target_core_fabric.h>
 #include <target/target_core_configfs.h>
 
 #include "target_core_internal.h"
index 71fc9cea5dc9ba120b725a4e0f6bf94c879d1340..dbbbc8376d01bef08790946ff33b8a28c3a7e981 100644 (file)
 #include <scsi/fc_encode.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
-#include <target/target_core_device.h>
-#include <target/target_core_tpg.h>
+#include <target/target_core_fabric.h>
 #include <target/target_core_configfs.h>
-#include <target/target_core_tmr.h>
 #include <target/configfs_macros.h>
 
 #include "tcm_fc.h"
index 9402b7387cac570d91ff6001a885daed3bbd8b6d..73852fbc857b4b5aee0622ee7b55fb5c0880291b 100644 (file)
 #include <scsi/libfc.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
+#include <target/target_core_fabric.h>
 #include <target/target_core_fabric_configfs.h>
-#include <target/target_core_fabric_lib.h>
-#include <target/target_core_device.h>
-#include <target/target_core_tpg.h>
 #include <target/target_core_configfs.h>
 #include <target/configfs_macros.h>
 
index 1369b1cb103d7d1e0ad4053322e599713445e9b7..d8cabc21036d3ec1040168b9940ab013c55b4a0b 100644 (file)
 #include <scsi/fc_encode.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
-#include <target/target_core_device.h>
-#include <target/target_core_tpg.h>
+#include <target/target_core_fabric.h>
 #include <target/target_core_configfs.h>
 #include <target/configfs_macros.h>
 
index 326921385aff973c17ce4f8598ba791c0fa94fc2..4c0507cf808c08662609765b41488a35c461add7 100644 (file)
 #include <scsi/libfc.h>
 
 #include <target/target_core_base.h>
-#include <target/target_core_transport.h>
-#include <target/target_core_fabric_ops.h>
-#include <target/target_core_device.h>
-#include <target/target_core_tpg.h>
+#include <target/target_core_fabric.h>
 #include <target/target_core_configfs.h>
 #include <target/configfs_macros.h>
 
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h
new file mode 100644 (file)
index 0000000..4866499
--- /dev/null
@@ -0,0 +1,65 @@
+#ifndef TARGET_CORE_BACKEND_H
+#define TARGET_CORE_BACKEND_H
+
+#define TRANSPORT_PLUGIN_PHBA_PDEV             1
+#define TRANSPORT_PLUGIN_VHBA_PDEV             2
+#define TRANSPORT_PLUGIN_VHBA_VDEV             3
+
+struct se_subsystem_api {
+       struct list_head sub_api_list;
+
+       char name[16];
+       struct module *owner;
+
+       u8 transport_type;
+
+       unsigned int fua_write_emulated : 1;
+       unsigned int write_cache_emulated : 1;
+
+       int (*attach_hba)(struct se_hba *, u32);
+       void (*detach_hba)(struct se_hba *);
+       int (*pmode_enable_hba)(struct se_hba *, unsigned long);
+       void *(*allocate_virtdevice)(struct se_hba *, const char *);
+       struct se_device *(*create_virtdevice)(struct se_hba *,
+                               struct se_subsystem_dev *, void *);
+       void (*free_device)(void *);
+       int (*transport_complete)(struct se_task *task);
+       struct se_task *(*alloc_task)(unsigned char *cdb);
+       int (*do_task)(struct se_task *);
+       int (*do_discard)(struct se_device *, sector_t, u32);
+       void (*do_sync_cache)(struct se_task *);
+       void (*free_task)(struct se_task *);
+       ssize_t (*check_configfs_dev_params)(struct se_hba *,
+                       struct se_subsystem_dev *);
+       ssize_t (*set_configfs_dev_params)(struct se_hba *,
+                       struct se_subsystem_dev *, const char *, ssize_t);
+       ssize_t (*show_configfs_dev_params)(struct se_hba *,
+                       struct se_subsystem_dev *, char *);
+       u32 (*get_device_rev)(struct se_device *);
+       u32 (*get_device_type)(struct se_device *);
+       sector_t (*get_blocks)(struct se_device *);
+       unsigned char *(*get_sense_buffer)(struct se_task *);
+};
+
+int    transport_subsystem_register(struct se_subsystem_api *);
+void   transport_subsystem_release(struct se_subsystem_api *);
+
+struct se_device *transport_add_device_to_core_hba(struct se_hba *,
+               struct se_subsystem_api *, struct se_subsystem_dev *, u32,
+               void *, struct se_dev_limits *, const char *, const char *);
+
+void   transport_complete_sync_cache(struct se_cmd *, int);
+void   transport_complete_task(struct se_task *, int);
+
+void   target_get_task_cdb(struct se_task *, unsigned char *);
+
+void   transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *);
+int    transport_set_vpd_assoc(struct t10_vpd *, unsigned char *);
+int    transport_set_vpd_ident_type(struct t10_vpd *, unsigned char *);
+int    transport_set_vpd_ident(struct t10_vpd *, unsigned char *);
+
+/* core helpers also used by command snooping in pscsi */
+void   *transport_kmap_first_data_page(struct se_cmd *);
+void   transport_kunmap_first_data_page(struct se_cmd *);
+
+#endif /* TARGET_CORE_BACKEND_H */
index 6873c7dd9145d2a23f682d9e8d2c695a7571d656..1d90fb33e60bd461886cdbe7e7238d80db0afb62 100644 (file)
@@ -10,6 +10,7 @@
 #include <net/tcp.h>
 
 #define TARGET_CORE_MOD_VERSION                "v4.1.0-rc1-ml"
+#define TARGET_CORE_VERSION            TARGET_CORE_MOD_VERSION
 
 /* Maximum Number of LUNs per Target Portal Group */
 /* Don't raise above 511 or REPORT_LUNS needs to handle >1 page */
 /* Used by transport_get_inquiry_vpd_device_ident() */
 #define INQUIRY_VPD_DEVICE_IDENTIFIER_LEN      254
 
+/* Attempts before moving from SHORT to LONG */
+#define PYX_TRANSPORT_WINDOW_CLOSED_THRESHOLD  3
+#define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_SHORT 3  /* In milliseconds */
+#define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_LONG  10 /* In milliseconds */
+
+#define PYX_TRANSPORT_STATUS_INTERVAL          5 /* In seconds */
+
+/*
+ * struct se_subsystem_dev->su_dev_flags
+*/
+#define SDF_FIRMWARE_VPD_UNIT_SERIAL           0x00000001
+#define SDF_EMULATED_VPD_UNIT_SERIAL           0x00000002
+#define SDF_USING_UDEV_PATH                    0x00000004
+#define SDF_USING_ALIAS                                0x00000008
+
+/*
+ * struct se_device->dev_flags
+ */
+#define DF_READ_ONLY                           0x00000001
+#define DF_SPC2_RESERVATIONS                   0x00000002
+#define DF_SPC2_RESERVATIONS_WITH_ISID         0x00000004
+
+/* struct se_dev_attrib sanity values */
+/* Default max_unmap_lba_count */
+#define DA_MAX_UNMAP_LBA_COUNT                 0
+/* Default max_unmap_block_desc_count */
+#define DA_MAX_UNMAP_BLOCK_DESC_COUNT          0
+/* Default unmap_granularity */
+#define DA_UNMAP_GRANULARITY_DEFAULT           0
+/* Default unmap_granularity_alignment */
+#define DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT 0
+/* Emulation for Direct Page Out */
+#define DA_EMULATE_DPO                         0
+/* Emulation for Forced Unit Access WRITEs */
+#define DA_EMULATE_FUA_WRITE                   1
+/* Emulation for Forced Unit Access READs */
+#define DA_EMULATE_FUA_READ                    0
+/* Emulation for WriteCache and SYNCHRONIZE_CACHE */
+#define DA_EMULATE_WRITE_CACHE                 0
+/* Emulation for UNIT ATTENTION Interlock Control */
+#define DA_EMULATE_UA_INTLLCK_CTRL             0
+/* Emulation for TASK_ABORTED status (TAS) by default */
+#define DA_EMULATE_TAS                         1
+/* Emulation for Thin Provisioning UNMAP using block/blk-lib.c:blkdev_issue_discard() */
+#define DA_EMULATE_TPU                         0
+/*
+ * Emulation for Thin Provisioning WRITE_SAME w/ UNMAP=1 bit using
+ * block/blk-lib.c:blkdev_issue_discard()
+ */
+#define DA_EMULATE_TPWS                                0
+/* No Emulation for PSCSI by default */
+#define DA_EMULATE_RESERVATIONS                        0
+/* No Emulation for PSCSI by default */
+#define DA_EMULATE_ALUA                                0
+/* Enforce SCSI Initiator Port TransportID with 'ISID' for PR */
+#define DA_ENFORCE_PR_ISIDS                    1
+#define DA_STATUS_MAX_SECTORS_MIN              16
+#define DA_STATUS_MAX_SECTORS_MAX              8192
+/* By default don't report non-rotating (solid state) medium */
+#define DA_IS_NONROT                           0
+/* Queue Algorithm Modifier default for restricted reordering in control mode page */
+#define DA_EMULATE_REST_REORD                  0
+
+#define SE_MODE_PAGE_BUF                       512
+
+
 /* struct se_hba->hba_flags */
 enum hba_flags_table {
        HBA_FLAGS_INTERNAL_USE  = 0x01,
@@ -158,6 +225,30 @@ enum tcm_sense_reason_table {
        TCM_RESERVATION_CONFLICT                = 0x10,
 };
 
+/* fabric independent task management function values */
+enum tcm_tmreq_table {
+       TMR_ABORT_TASK          = 1,
+       TMR_ABORT_TASK_SET      = 2,
+       TMR_CLEAR_ACA           = 3,
+       TMR_CLEAR_TASK_SET      = 4,
+       TMR_LUN_RESET           = 5,
+       TMR_TARGET_WARM_RESET   = 6,
+       TMR_TARGET_COLD_RESET   = 7,
+       TMR_FABRIC_TMR          = 255,
+};
+
+/* fabric independent task management response values */
+enum tcm_tmrsp_table {
+       TMR_FUNCTION_COMPLETE           = 0,
+       TMR_TASK_DOES_NOT_EXIST         = 1,
+       TMR_LUN_DOES_NOT_EXIST          = 2,
+       TMR_TASK_STILL_ALLEGIANT        = 3,
+       TMR_TASK_FAILOVER_NOT_SUPPORTED = 4,
+       TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED    = 5,
+       TMR_FUNCTION_AUTHORIZATION_FAILED = 6,
+       TMR_FUNCTION_REJECTED           = 255,
+};
+
 struct se_obj {
        atomic_t obj_access_count;
 } ____cacheline_aligned;
diff --git a/include/target/target_core_device.h b/include/target/target_core_device.h
deleted file mode 100644 (file)
index c6123a4..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef TARGET_CORE_DEVICE_H
-#define TARGET_CORE_DEVICE_H
-
-
-// external
-extern int transport_lookup_cmd_lun(struct se_cmd *, u32);
-extern int transport_lookup_tmr_lun(struct se_cmd *, u32);
-
-#endif /* TARGET_CORE_DEVICE_H */
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h
new file mode 100644 (file)
index 0000000..d035d86
--- /dev/null
@@ -0,0 +1,189 @@
+#ifndef TARGET_CORE_FABRIC_H
+#define TARGET_CORE_FABRIC_H
+
+struct target_core_fabric_ops {
+       struct configfs_subsystem *tf_subsys;
+       /*
+        * Optional to signal struct se_task->task_sg[] padding entries
+        * for scatterlist chaining using transport_do_task_sg_link(),
+        * disabled by default
+        */
+       bool task_sg_chaining;
+       char *(*get_fabric_name)(void);
+       u8 (*get_fabric_proto_ident)(struct se_portal_group *);
+       char *(*tpg_get_wwn)(struct se_portal_group *);
+       u16 (*tpg_get_tag)(struct se_portal_group *);
+       u32 (*tpg_get_default_depth)(struct se_portal_group *);
+       u32 (*tpg_get_pr_transport_id)(struct se_portal_group *,
+                               struct se_node_acl *,
+                               struct t10_pr_registration *, int *,
+                               unsigned char *);
+       u32 (*tpg_get_pr_transport_id_len)(struct se_portal_group *,
+                               struct se_node_acl *,
+                               struct t10_pr_registration *, int *);
+       char *(*tpg_parse_pr_out_transport_id)(struct se_portal_group *,
+                               const char *, u32 *, char **);
+       int (*tpg_check_demo_mode)(struct se_portal_group *);
+       int (*tpg_check_demo_mode_cache)(struct se_portal_group *);
+       int (*tpg_check_demo_mode_write_protect)(struct se_portal_group *);
+       int (*tpg_check_prod_mode_write_protect)(struct se_portal_group *);
+       /*
+        * Optionally used by fabrics to allow demo-mode login, but not
+        * expose any TPG LUNs, and return 'not connected' in standard
+        * inquiry response
+        */
+       int (*tpg_check_demo_mode_login_only)(struct se_portal_group *);
+       struct se_node_acl *(*tpg_alloc_fabric_acl)(
+                                       struct se_portal_group *);
+       void (*tpg_release_fabric_acl)(struct se_portal_group *,
+                                       struct se_node_acl *);
+       u32 (*tpg_get_inst_index)(struct se_portal_group *);
+       /*
+        * Optional function pointer for TCM to perform command map
+        * from TCM processing thread context, for those struct se_cmd
+        * initially allocated in interrupt context.
+        */
+       int (*new_cmd_map)(struct se_cmd *);
+       /*
+        * Optional to release struct se_cmd and fabric dependent allocated
+        * I/O descriptor in transport_cmd_check_stop().
+        *
+        * Returning 1 will signal a descriptor has been released.
+        * Returning 0 will signal a descriptor has not been released.
+        */
+       int (*check_stop_free)(struct se_cmd *);
+       /*
+        * Optional check for active I/O shutdown
+        */
+       int (*check_release_cmd)(struct se_cmd *);
+       void (*release_cmd)(struct se_cmd *);
+       /*
+        * Called with spin_lock_bh(struct se_portal_group->session_lock held.
+        */
+       int (*shutdown_session)(struct se_session *);
+       void (*close_session)(struct se_session *);
+       void (*stop_session)(struct se_session *, int, int);
+       void (*fall_back_to_erl0)(struct se_session *);
+       int (*sess_logged_in)(struct se_session *);
+       u32 (*sess_get_index)(struct se_session *);
+       /*
+        * Used only for SCSI fabrics that contain multi-value TransportIDs
+        * (like iSCSI).  All other SCSI fabrics should set this to NULL.
+        */
+       u32 (*sess_get_initiator_sid)(struct se_session *,
+                                     unsigned char *, u32);
+       int (*write_pending)(struct se_cmd *);
+       int (*write_pending_status)(struct se_cmd *);
+       void (*set_default_node_attributes)(struct se_node_acl *);
+       u32 (*get_task_tag)(struct se_cmd *);
+       int (*get_cmd_state)(struct se_cmd *);
+       int (*queue_data_in)(struct se_cmd *);
+       int (*queue_status)(struct se_cmd *);
+       int (*queue_tm_rsp)(struct se_cmd *);
+       u16 (*set_fabric_sense_len)(struct se_cmd *, u32);
+       u16 (*get_fabric_sense_len)(void);
+       int (*is_state_remove)(struct se_cmd *);
+       /*
+        * fabric module calls for target_core_fabric_configfs.c
+        */
+       struct se_wwn *(*fabric_make_wwn)(struct target_fabric_configfs *,
+                               struct config_group *, const char *);
+       void (*fabric_drop_wwn)(struct se_wwn *);
+       struct se_portal_group *(*fabric_make_tpg)(struct se_wwn *,
+                               struct config_group *, const char *);
+       void (*fabric_drop_tpg)(struct se_portal_group *);
+       int (*fabric_post_link)(struct se_portal_group *,
+                               struct se_lun *);
+       void (*fabric_pre_unlink)(struct se_portal_group *,
+                               struct se_lun *);
+       struct se_tpg_np *(*fabric_make_np)(struct se_portal_group *,
+                               struct config_group *, const char *);
+       void (*fabric_drop_np)(struct se_tpg_np *);
+       struct se_node_acl *(*fabric_make_nodeacl)(struct se_portal_group *,
+                               struct config_group *, const char *);
+       void (*fabric_drop_nodeacl)(struct se_node_acl *);
+};
+
+struct se_session *transport_init_session(void);
+void   __transport_register_session(struct se_portal_group *,
+               struct se_node_acl *, struct se_session *, void *);
+void   transport_register_session(struct se_portal_group *,
+               struct se_node_acl *, struct se_session *, void *);
+void   transport_free_session(struct se_session *);
+void   transport_deregister_session_configfs(struct se_session *);
+void   transport_deregister_session(struct se_session *);
+
+
+void   transport_init_se_cmd(struct se_cmd *, struct target_core_fabric_ops *,
+               struct se_session *, u32, int, int, unsigned char *);
+int    transport_lookup_cmd_lun(struct se_cmd *, u32);
+int    transport_generic_allocate_tasks(struct se_cmd *, unsigned char *);
+int    transport_handle_cdb_direct(struct se_cmd *);
+int    transport_generic_handle_cdb_map(struct se_cmd *);
+int    transport_generic_handle_data(struct se_cmd *);
+int    transport_generic_map_mem_to_cmd(struct se_cmd *cmd,
+               struct scatterlist *, u32, struct scatterlist *, u32);
+void   transport_do_task_sg_chain(struct se_cmd *);
+int    transport_generic_new_cmd(struct se_cmd *);
+
+void   transport_generic_process_write(struct se_cmd *);
+
+void   transport_generic_free_cmd(struct se_cmd *, int);
+
+bool   transport_wait_for_tasks(struct se_cmd *);
+int    transport_check_aborted_status(struct se_cmd *, int);
+int    transport_send_check_condition_and_sense(struct se_cmd *, u8, int);
+
+void   target_get_sess_cmd(struct se_session *, struct se_cmd *);
+int    target_put_sess_cmd(struct se_session *, struct se_cmd *);
+void   target_splice_sess_cmd_list(struct se_session *);
+void   target_wait_for_sess_cmds(struct se_session *, int);
+
+int    core_alua_check_nonop_delay(struct se_cmd *);
+
+struct se_tmr_req *core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t);
+void   core_tmr_release_req(struct se_tmr_req *);
+int    transport_generic_handle_tmr(struct se_cmd *);
+int    transport_lookup_tmr_lun(struct se_cmd *, u32);
+
+struct se_node_acl *core_tpg_check_initiator_node_acl(struct se_portal_group *,
+               unsigned char *);
+void   core_tpg_clear_object_luns(struct se_portal_group *);
+struct se_node_acl *core_tpg_add_initiator_node_acl(struct se_portal_group *,
+               struct se_node_acl *, const char *, u32);
+int    core_tpg_del_initiator_node_acl(struct se_portal_group *,
+               struct se_node_acl *, int);
+int    core_tpg_set_initiator_node_queue_depth(struct se_portal_group *,
+               unsigned char *, u32, int);
+int    core_tpg_register(struct target_core_fabric_ops *, struct se_wwn *,
+               struct se_portal_group *, void *, int);
+int    core_tpg_deregister(struct se_portal_group *);
+
+/* SAS helpers */
+u8     sas_get_fabric_proto_ident(struct se_portal_group *);
+u32    sas_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *,
+               struct t10_pr_registration *, int *, unsigned char *);
+u32    sas_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *,
+               struct t10_pr_registration *, int *);
+char   *sas_parse_pr_out_transport_id(struct se_portal_group *, const char *,
+               u32 *, char **);
+
+/* FC helpers */
+u8     fc_get_fabric_proto_ident(struct se_portal_group *);
+u32    fc_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *,
+               struct t10_pr_registration *, int *, unsigned char *);
+u32    fc_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *,
+               struct t10_pr_registration *, int *);
+char   *fc_parse_pr_out_transport_id(struct se_portal_group *, const char *,
+               u32 *, char **);
+
+/* iSCSI helpers */
+u8     iscsi_get_fabric_proto_ident(struct se_portal_group *);
+u32    iscsi_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *,
+               struct t10_pr_registration *, int *, unsigned char *);
+u32    iscsi_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *,
+               struct t10_pr_registration *, int *);
+char   *iscsi_parse_pr_out_transport_id(struct se_portal_group *, const char *,
+               u32 *, char **);
+
+#endif /* TARGET_CORE_FABRICH */
diff --git a/include/target/target_core_fabric_lib.h b/include/target/target_core_fabric_lib.h
deleted file mode 100644 (file)
index c2f8d0e..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef TARGET_CORE_FABRIC_LIB_H
-#define TARGET_CORE_FABRIC_LIB_H
-
-extern u8 sas_get_fabric_proto_ident(struct se_portal_group *);
-extern u32 sas_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *,
-                       struct t10_pr_registration *, int *, unsigned char *);
-extern u32 sas_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *,
-                       struct t10_pr_registration *, int *);
-extern char *sas_parse_pr_out_transport_id(struct se_portal_group *,
-                       const char *, u32 *, char **);
-
-extern u8 fc_get_fabric_proto_ident(struct se_portal_group *);
-extern u32 fc_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *,
-                       struct t10_pr_registration *, int *, unsigned char *);
-extern u32 fc_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *,
-                       struct t10_pr_registration *, int *);
-extern char *fc_parse_pr_out_transport_id(struct se_portal_group *,
-                       const char *, u32 *, char **);
-
-extern u8 iscsi_get_fabric_proto_ident(struct se_portal_group *);
-extern u32 iscsi_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *,
-                       struct t10_pr_registration *, int *, unsigned char *);
-extern u32 iscsi_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *,
-                       struct t10_pr_registration *, int *);
-extern char *iscsi_parse_pr_out_transport_id(struct se_portal_group *,
-                       const char *, u32 *, char **);
-
-#endif /* TARGET_CORE_FABRIC_LIB_H */
diff --git a/include/target/target_core_fabric_ops.h b/include/target/target_core_fabric_ops.h
deleted file mode 100644 (file)
index 0256825..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Defined in target_core_configfs.h */
-struct target_fabric_configfs;
-
-struct target_core_fabric_ops {
-       struct configfs_subsystem *tf_subsys;
-       /*
-        * Optional to signal struct se_task->task_sg[] padding entries
-        * for scatterlist chaining using transport_do_task_sg_link(),
-        * disabled by default
-        */
-       bool task_sg_chaining;
-       char *(*get_fabric_name)(void);
-       u8 (*get_fabric_proto_ident)(struct se_portal_group *);
-       char *(*tpg_get_wwn)(struct se_portal_group *);
-       u16 (*tpg_get_tag)(struct se_portal_group *);
-       u32 (*tpg_get_default_depth)(struct se_portal_group *);
-       u32 (*tpg_get_pr_transport_id)(struct se_portal_group *,
-                               struct se_node_acl *,
-                               struct t10_pr_registration *, int *,
-                               unsigned char *);
-       u32 (*tpg_get_pr_transport_id_len)(struct se_portal_group *,
-                               struct se_node_acl *,
-                               struct t10_pr_registration *, int *);
-       char *(*tpg_parse_pr_out_transport_id)(struct se_portal_group *,
-                               const char *, u32 *, char **);
-       int (*tpg_check_demo_mode)(struct se_portal_group *);
-       int (*tpg_check_demo_mode_cache)(struct se_portal_group *);
-       int (*tpg_check_demo_mode_write_protect)(struct se_portal_group *);
-       int (*tpg_check_prod_mode_write_protect)(struct se_portal_group *);
-       /*
-        * Optionally used by fabrics to allow demo-mode login, but not
-        * expose any TPG LUNs, and return 'not connected' in standard
-        * inquiry response
-        */
-       int (*tpg_check_demo_mode_login_only)(struct se_portal_group *);
-       struct se_node_acl *(*tpg_alloc_fabric_acl)(
-                                       struct se_portal_group *);
-       void (*tpg_release_fabric_acl)(struct se_portal_group *,
-                                       struct se_node_acl *);
-       u32 (*tpg_get_inst_index)(struct se_portal_group *);
-       /*
-        * Optional function pointer for TCM to perform command map
-        * from TCM processing thread context, for those struct se_cmd
-        * initially allocated in interrupt context.
-        */
-       int (*new_cmd_map)(struct se_cmd *);
-       /*
-        * Optional to release struct se_cmd and fabric dependent allocated
-        * I/O descriptor in transport_cmd_check_stop().
-        *
-        * Returning 1 will signal a descriptor has been released.
-        * Returning 0 will signal a descriptor has not been released.
-        */
-       int (*check_stop_free)(struct se_cmd *);
-       /*
-        * Optional check for active I/O shutdown
-        */
-       int (*check_release_cmd)(struct se_cmd *);
-       void (*release_cmd)(struct se_cmd *);
-       /*
-        * Called with spin_lock_bh(struct se_portal_group->session_lock held.
-        */
-       int (*shutdown_session)(struct se_session *);
-       void (*close_session)(struct se_session *);
-       void (*stop_session)(struct se_session *, int, int);
-       void (*fall_back_to_erl0)(struct se_session *);
-       int (*sess_logged_in)(struct se_session *);
-       u32 (*sess_get_index)(struct se_session *);
-       /*
-        * Used only for SCSI fabrics that contain multi-value TransportIDs
-        * (like iSCSI).  All other SCSI fabrics should set this to NULL.
-        */
-       u32 (*sess_get_initiator_sid)(struct se_session *,
-                                     unsigned char *, u32);
-       int (*write_pending)(struct se_cmd *);
-       int (*write_pending_status)(struct se_cmd *);
-       void (*set_default_node_attributes)(struct se_node_acl *);
-       u32 (*get_task_tag)(struct se_cmd *);
-       int (*get_cmd_state)(struct se_cmd *);
-       int (*queue_data_in)(struct se_cmd *);
-       int (*queue_status)(struct se_cmd *);
-       int (*queue_tm_rsp)(struct se_cmd *);
-       u16 (*set_fabric_sense_len)(struct se_cmd *, u32);
-       u16 (*get_fabric_sense_len)(void);
-       int (*is_state_remove)(struct se_cmd *);
-       /*
-        * fabric module calls for target_core_fabric_configfs.c
-        */
-       struct se_wwn *(*fabric_make_wwn)(struct target_fabric_configfs *,
-                               struct config_group *, const char *);
-       void (*fabric_drop_wwn)(struct se_wwn *);
-       struct se_portal_group *(*fabric_make_tpg)(struct se_wwn *,
-                               struct config_group *, const char *);
-       void (*fabric_drop_tpg)(struct se_portal_group *);
-       int (*fabric_post_link)(struct se_portal_group *,
-                               struct se_lun *);
-       void (*fabric_pre_unlink)(struct se_portal_group *,
-                               struct se_lun *);
-       struct se_tpg_np *(*fabric_make_np)(struct se_portal_group *,
-                               struct config_group *, const char *);
-       void (*fabric_drop_np)(struct se_tpg_np *);
-       struct se_node_acl *(*fabric_make_nodeacl)(struct se_portal_group *,
-                               struct config_group *, const char *);
-       void (*fabric_drop_nodeacl)(struct se_node_acl *);
-};
diff --git a/include/target/target_core_tmr.h b/include/target/target_core_tmr.h
deleted file mode 100644 (file)
index 36b3e0d..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef TARGET_CORE_TMR_H
-#define TARGET_CORE_TMR_H
-
-/* fabric independent task management function values */
-enum tcm_tmreq_table {
-       TMR_ABORT_TASK          = 1,
-       TMR_ABORT_TASK_SET      = 2,
-       TMR_CLEAR_ACA           = 3,
-       TMR_CLEAR_TASK_SET      = 4,
-       TMR_LUN_RESET           = 5,
-       TMR_TARGET_WARM_RESET   = 6,
-       TMR_TARGET_COLD_RESET   = 7,
-       TMR_FABRIC_TMR          = 255,
-};
-
-/* fabric independent task management response values */
-enum tcm_tmrsp_table {
-       TMR_FUNCTION_COMPLETE           = 0,
-       TMR_TASK_DOES_NOT_EXIST         = 1,
-       TMR_LUN_DOES_NOT_EXIST          = 2,
-       TMR_TASK_STILL_ALLEGIANT        = 3,
-       TMR_TASK_FAILOVER_NOT_SUPPORTED = 4,
-       TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED    = 5,
-       TMR_FUNCTION_AUTHORIZATION_FAILED = 6,
-       TMR_FUNCTION_REJECTED           = 255,
-};
-
-extern struct se_tmr_req *core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t);
-extern void core_tmr_release_req(struct se_tmr_req *);
-
-#endif /* TARGET_CORE_TMR_H */
diff --git a/include/target/target_core_tpg.h b/include/target/target_core_tpg.h
deleted file mode 100644 (file)
index 80ae59f..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef TARGET_CORE_TPG_H
-#define TARGET_CORE_TPG_H
-
-extern struct se_node_acl *core_tpg_check_initiator_node_acl(
-                                               struct se_portal_group *,
-                                               unsigned char *);
-extern void core_tpg_clear_object_luns(struct se_portal_group *);
-extern struct se_node_acl *core_tpg_add_initiator_node_acl(
-                                       struct se_portal_group *,
-                                       struct se_node_acl *,
-                                       const char *, u32);
-extern int core_tpg_del_initiator_node_acl(struct se_portal_group *,
-                                               struct se_node_acl *, int);
-extern int core_tpg_set_initiator_node_queue_depth(struct se_portal_group *,
-                                               unsigned char *, u32, int);
-extern int core_tpg_register(struct target_core_fabric_ops *,
-                                       struct se_wwn *,
-                                       struct se_portal_group *, void *,
-                                       int);
-extern int core_tpg_deregister(struct se_portal_group *);
-
-#endif /* TARGET_CORE_TPG_H */
diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h
deleted file mode 100644 (file)
index 68fe1f2..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-#ifndef TARGET_CORE_TRANSPORT_H
-#define TARGET_CORE_TRANSPORT_H
-
-#define TARGET_CORE_VERSION                    TARGET_CORE_MOD_VERSION
-
-/* Attempts before moving from SHORT to LONG */
-#define PYX_TRANSPORT_WINDOW_CLOSED_THRESHOLD  3
-#define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_SHORT 3  /* In milliseconds */
-#define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_LONG  10 /* In milliseconds */
-
-#define PYX_TRANSPORT_STATUS_INTERVAL          5 /* In seconds */
-
-#define TRANSPORT_PLUGIN_PHBA_PDEV             1
-#define TRANSPORT_PLUGIN_VHBA_PDEV             2
-#define TRANSPORT_PLUGIN_VHBA_VDEV             3
-
-/*
- * struct se_subsystem_dev->su_dev_flags
-*/
-#define SDF_FIRMWARE_VPD_UNIT_SERIAL           0x00000001
-#define SDF_EMULATED_VPD_UNIT_SERIAL           0x00000002
-#define SDF_USING_UDEV_PATH                    0x00000004
-#define SDF_USING_ALIAS                                0x00000008
-
-/*
- * struct se_device->dev_flags
- */
-#define DF_READ_ONLY                           0x00000001
-#define DF_SPC2_RESERVATIONS                   0x00000002
-#define DF_SPC2_RESERVATIONS_WITH_ISID         0x00000004
-
-/* struct se_dev_attrib sanity values */
-/* Default max_unmap_lba_count */
-#define DA_MAX_UNMAP_LBA_COUNT                 0
-/* Default max_unmap_block_desc_count */
-#define DA_MAX_UNMAP_BLOCK_DESC_COUNT          0
-/* Default unmap_granularity */
-#define DA_UNMAP_GRANULARITY_DEFAULT           0
-/* Default unmap_granularity_alignment */
-#define DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT 0
-/* Emulation for Direct Page Out */
-#define DA_EMULATE_DPO                         0
-/* Emulation for Forced Unit Access WRITEs */
-#define DA_EMULATE_FUA_WRITE                   1
-/* Emulation for Forced Unit Access READs */
-#define DA_EMULATE_FUA_READ                    0
-/* Emulation for WriteCache and SYNCHRONIZE_CACHE */
-#define DA_EMULATE_WRITE_CACHE                 0
-/* Emulation for UNIT ATTENTION Interlock Control */
-#define DA_EMULATE_UA_INTLLCK_CTRL             0
-/* Emulation for TASK_ABORTED status (TAS) by default */
-#define DA_EMULATE_TAS                         1
-/* Emulation for Thin Provisioning UNMAP using block/blk-lib.c:blkdev_issue_discard() */
-#define DA_EMULATE_TPU                         0
-/*
- * Emulation for Thin Provisioning WRITE_SAME w/ UNMAP=1 bit using
- * block/blk-lib.c:blkdev_issue_discard()
- */
-#define DA_EMULATE_TPWS                                0
-/* No Emulation for PSCSI by default */
-#define DA_EMULATE_RESERVATIONS                        0
-/* No Emulation for PSCSI by default */
-#define DA_EMULATE_ALUA                                0
-/* Enforce SCSI Initiator Port TransportID with 'ISID' for PR */
-#define DA_ENFORCE_PR_ISIDS                    1
-#define DA_STATUS_MAX_SECTORS_MIN              16
-#define DA_STATUS_MAX_SECTORS_MAX              8192
-/* By default don't report non-rotating (solid state) medium */
-#define DA_IS_NONROT                           0
-/* Queue Algorithm Modifier default for restricted reordering in control mode page */
-#define DA_EMULATE_REST_REORD                  0
-
-#define SE_MODE_PAGE_BUF                       512
-
-#define MOD_MAX_SECTORS(ms, bs)                        (ms % (PAGE_SIZE / bs))
-
-struct se_subsystem_api;
-
-extern int transport_subsystem_register(struct se_subsystem_api *);
-extern void transport_subsystem_release(struct se_subsystem_api *);
-extern struct se_session *transport_init_session(void);
-extern void __transport_register_session(struct se_portal_group *,
-                                       struct se_node_acl *,
-                                       struct se_session *, void *);
-extern void transport_register_session(struct se_portal_group *,
-                                       struct se_node_acl *,
-                                       struct se_session *, void *);
-extern void transport_free_session(struct se_session *);
-extern void transport_deregister_session_configfs(struct se_session *);
-extern void transport_deregister_session(struct se_session *);
-extern void transport_complete_sync_cache(struct se_cmd *, int);
-extern void transport_complete_task(struct se_task *, int);
-
-extern void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *);
-extern int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *);
-extern int transport_set_vpd_ident_type(struct t10_vpd *, unsigned char *);
-extern int transport_set_vpd_ident(struct t10_vpd *, unsigned char *);
-
-extern struct se_device *transport_add_device_to_core_hba(struct se_hba *,
-                                       struct se_subsystem_api *,
-                                       struct se_subsystem_dev *, u32,
-                                       void *, struct se_dev_limits *,
-                                       const char *, const char *);
-extern void transport_init_se_cmd(struct se_cmd *,
-                                       struct target_core_fabric_ops *,
-                                       struct se_session *, u32, int, int,
-                                       unsigned char *);
-void *transport_kmap_first_data_page(struct se_cmd *cmd);
-void transport_kunmap_first_data_page(struct se_cmd *cmd);
-extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *);
-extern int transport_handle_cdb_direct(struct se_cmd *);
-extern int transport_generic_handle_cdb_map(struct se_cmd *);
-extern int transport_generic_handle_data(struct se_cmd *);
-extern int transport_generic_handle_tmr(struct se_cmd *);
-extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32,
-                               struct scatterlist *, u32);
-extern bool transport_wait_for_tasks(struct se_cmd *);
-extern int transport_check_aborted_status(struct se_cmd *, int);
-extern int transport_send_check_condition_and_sense(struct se_cmd *, u8, int);
-extern void transport_generic_free_cmd(struct se_cmd *, int);
-extern void target_get_sess_cmd(struct se_session *, struct se_cmd *);
-extern int target_put_sess_cmd(struct se_session *, struct se_cmd *);
-extern void target_splice_sess_cmd_list(struct se_session *);
-extern void target_wait_for_sess_cmds(struct se_session *, int);
-extern void transport_do_task_sg_chain(struct se_cmd *);
-extern void transport_generic_process_write(struct se_cmd *);
-extern int transport_generic_new_cmd(struct se_cmd *);
-/* From target_core_alua.c */
-extern int core_alua_check_nonop_delay(struct se_cmd *);
-/* From target_core_cdb.c */
-extern void target_get_task_cdb(struct se_task *task, unsigned char *cdb);
-
-/*
- * Each se_transport_task_t can have N number of possible struct se_task's
- * for the storage transport(s) to possibly execute.
- * Used primarily for splitting up CDBs that exceed the physical storage
- * HBA's maximum sector count per task.
- */
-struct se_mem {
-       struct page     *se_page;
-       u32             se_len;
-       u32             se_off;
-       struct list_head se_list;
-} ____cacheline_aligned;
-
-/*
- *     Each type of disk transport supported MUST have a template defined
- *     within its .h file.
- */
-struct se_subsystem_api {
-       /*
-        * The Name. :-)
-        */
-       char name[16];
-       /*
-        * Transport Type.
-        */
-       u8 transport_type;
-
-       unsigned int fua_write_emulated : 1;
-       unsigned int write_cache_emulated : 1;
-
-       /*
-        * struct module for struct se_hba references
-        */
-       struct module *owner;
-       /*
-        * Used for global se_subsystem_api list_head
-        */
-       struct list_head sub_api_list;
-       /*
-        * attach_hba():
-        */
-       int (*attach_hba)(struct se_hba *, u32);
-       /*
-        * detach_hba():
-        */
-       void (*detach_hba)(struct se_hba *);
-       /*
-        * pmode_hba(): Used for TCM/pSCSI subsystem plugin HBA ->
-        *              Linux/SCSI struct Scsi_Host passthrough
-       */
-       int (*pmode_enable_hba)(struct se_hba *, unsigned long);
-       /*
-        * allocate_virtdevice():
-        */
-       void *(*allocate_virtdevice)(struct se_hba *, const char *);
-       /*
-        * create_virtdevice(): Only for Virtual HBAs
-        */
-       struct se_device *(*create_virtdevice)(struct se_hba *,
-                               struct se_subsystem_dev *, void *);
-       /*
-        * free_device():
-        */
-       void (*free_device)(void *);
-
-       /*
-        * transport_complete():
-        *
-        * Use transport_generic_complete() for majority of DAS transport
-        * drivers.  Provided out of convenience.
-        */
-       int (*transport_complete)(struct se_task *task);
-       struct se_task *(*alloc_task)(unsigned char *cdb);
-       /*
-        * do_task():
-        */
-       int (*do_task)(struct se_task *);
-       /*
-        * Used by virtual subsystem plugins IBLOCK and FILEIO to emulate
-        * UNMAP and WRITE_SAME_* w/ UNMAP=1 <-> Linux/Block Discard
-        */
-       int (*do_discard)(struct se_device *, sector_t, u32);
-       /*
-        * Used  by virtual subsystem plugins IBLOCK and FILEIO to emulate
-        * SYNCHRONIZE_CACHE_* <-> Linux/Block blkdev_issue_flush()
-        */
-       void (*do_sync_cache)(struct se_task *);
-       /*
-        * free_task():
-        */
-       void (*free_task)(struct se_task *);
-       /*
-        * check_configfs_dev_params():
-        */
-       ssize_t (*check_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *);
-       /*
-        * set_configfs_dev_params():
-        */
-       ssize_t (*set_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *,
-                                               const char *, ssize_t);
-       /*
-        * show_configfs_dev_params():
-        */
-       ssize_t (*show_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *,
-                                               char *);
-       /*
-        * get_device_rev():
-        */
-       u32 (*get_device_rev)(struct se_device *);
-       /*
-        * get_device_type():
-        */
-       u32 (*get_device_type)(struct se_device *);
-       /*
-        * Get the sector_t from a subsystem backstore..
-        */
-       sector_t (*get_blocks)(struct se_device *);
-       /*
-        * get_sense_buffer():
-        */
-       unsigned char *(*get_sense_buffer)(struct se_task *);
-} ____cacheline_aligned;
-
-#endif /* TARGET_CORE_TRANSPORT_H */