diff options
Diffstat (limited to 'Documentation/target/tcm_mod_builder.py')
| -rwxr-xr-x | Documentation/target/tcm_mod_builder.py | 49 |
1 files changed, 12 insertions, 37 deletions
diff --git a/Documentation/target/tcm_mod_builder.py b/Documentation/target/tcm_mod_builder.py index 230ce71f4d75..2b47704f75cb 100755 --- a/Documentation/target/tcm_mod_builder.py +++ b/Documentation/target/tcm_mod_builder.py | |||
| @@ -389,9 +389,6 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name): | |||
| 389 | buf += " .release_cmd = " + fabric_mod_name + "_release_cmd,\n" | 389 | buf += " .release_cmd = " + fabric_mod_name + "_release_cmd,\n" |
| 390 | buf += " .shutdown_session = " + fabric_mod_name + "_shutdown_session,\n" | 390 | buf += " .shutdown_session = " + fabric_mod_name + "_shutdown_session,\n" |
| 391 | buf += " .close_session = " + fabric_mod_name + "_close_session,\n" | 391 | buf += " .close_session = " + fabric_mod_name + "_close_session,\n" |
| 392 | buf += " .stop_session = " + fabric_mod_name + "_stop_session,\n" | ||
| 393 | buf += " .fall_back_to_erl0 = " + fabric_mod_name + "_reset_nexus,\n" | ||
| 394 | buf += " .sess_logged_in = " + fabric_mod_name + "_sess_logged_in,\n" | ||
| 395 | buf += " .sess_get_index = " + fabric_mod_name + "_sess_get_index,\n" | 392 | buf += " .sess_get_index = " + fabric_mod_name + "_sess_get_index,\n" |
| 396 | buf += " .sess_get_initiator_sid = NULL,\n" | 393 | buf += " .sess_get_initiator_sid = NULL,\n" |
| 397 | buf += " .write_pending = " + fabric_mod_name + "_write_pending,\n" | 394 | buf += " .write_pending = " + fabric_mod_name + "_write_pending,\n" |
| @@ -402,7 +399,7 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name): | |||
| 402 | buf += " .queue_data_in = " + fabric_mod_name + "_queue_data_in,\n" | 399 | buf += " .queue_data_in = " + fabric_mod_name + "_queue_data_in,\n" |
| 403 | buf += " .queue_status = " + fabric_mod_name + "_queue_status,\n" | 400 | buf += " .queue_status = " + fabric_mod_name + "_queue_status,\n" |
| 404 | buf += " .queue_tm_rsp = " + fabric_mod_name + "_queue_tm_rsp,\n" | 401 | buf += " .queue_tm_rsp = " + fabric_mod_name + "_queue_tm_rsp,\n" |
| 405 | buf += " .is_state_remove = " + fabric_mod_name + "_is_state_remove,\n" | 402 | buf += " .aborted_task = " + fabric_mod_name + "_aborted_task,\n" |
| 406 | buf += " /*\n" | 403 | buf += " /*\n" |
| 407 | buf += " * Setup function pointers for generic logic in target_core_fabric_configfs.c\n" | 404 | buf += " * Setup function pointers for generic logic in target_core_fabric_configfs.c\n" |
| 408 | buf += " */\n" | 405 | buf += " */\n" |
| @@ -428,7 +425,7 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name): | |||
| 428 | buf += " /*\n" | 425 | buf += " /*\n" |
| 429 | buf += " * Register the top level struct config_item_type with TCM core\n" | 426 | buf += " * Register the top level struct config_item_type with TCM core\n" |
| 430 | buf += " */\n" | 427 | buf += " */\n" |
| 431 | buf += " fabric = target_fabric_configfs_init(THIS_MODULE, \"" + fabric_mod_name[4:] + "\");\n" | 428 | buf += " fabric = target_fabric_configfs_init(THIS_MODULE, \"" + fabric_mod_name + "\");\n" |
| 432 | buf += " if (IS_ERR(fabric)) {\n" | 429 | buf += " if (IS_ERR(fabric)) {\n" |
| 433 | buf += " printk(KERN_ERR \"target_fabric_configfs_init() failed\\n\");\n" | 430 | buf += " printk(KERN_ERR \"target_fabric_configfs_init() failed\\n\");\n" |
| 434 | buf += " return PTR_ERR(fabric);\n" | 431 | buf += " return PTR_ERR(fabric);\n" |
| @@ -595,7 +592,7 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name): | |||
| 595 | if re.search('get_fabric_name', fo): | 592 | if re.search('get_fabric_name', fo): |
| 596 | buf += "char *" + fabric_mod_name + "_get_fabric_name(void)\n" | 593 | buf += "char *" + fabric_mod_name + "_get_fabric_name(void)\n" |
| 597 | buf += "{\n" | 594 | buf += "{\n" |
| 598 | buf += " return \"" + fabric_mod_name[4:] + "\";\n" | 595 | buf += " return \"" + fabric_mod_name + "\";\n" |
| 599 | buf += "}\n\n" | 596 | buf += "}\n\n" |
| 600 | bufi += "char *" + fabric_mod_name + "_get_fabric_name(void);\n" | 597 | bufi += "char *" + fabric_mod_name + "_get_fabric_name(void);\n" |
| 601 | continue | 598 | continue |
| @@ -820,27 +817,6 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name): | |||
| 820 | buf += "}\n\n" | 817 | buf += "}\n\n" |
| 821 | bufi += "void " + fabric_mod_name + "_close_session(struct se_session *);\n" | 818 | bufi += "void " + fabric_mod_name + "_close_session(struct se_session *);\n" |
| 822 | 819 | ||
| 823 | if re.search('stop_session\)\(', fo): | ||
| 824 | buf += "void " + fabric_mod_name + "_stop_session(struct se_session *se_sess, int sess_sleep , int conn_sleep)\n" | ||
| 825 | buf += "{\n" | ||
| 826 | buf += " return;\n" | ||
| 827 | buf += "}\n\n" | ||
| 828 | bufi += "void " + fabric_mod_name + "_stop_session(struct se_session *, int, int);\n" | ||
| 829 | |||
| 830 | if re.search('fall_back_to_erl0\)\(', fo): | ||
| 831 | buf += "void " + fabric_mod_name + "_reset_nexus(struct se_session *se_sess)\n" | ||
| 832 | buf += "{\n" | ||
| 833 | buf += " return;\n" | ||
| 834 | buf += "}\n\n" | ||
| 835 | bufi += "void " + fabric_mod_name + "_reset_nexus(struct se_session *);\n" | ||
| 836 | |||
| 837 | if re.search('sess_logged_in\)\(', fo): | ||
| 838 | buf += "int " + fabric_mod_name + "_sess_logged_in(struct se_session *se_sess)\n" | ||
| 839 | buf += "{\n" | ||
| 840 | buf += " return 0;\n" | ||
| 841 | buf += "}\n\n" | ||
| 842 | bufi += "int " + fabric_mod_name + "_sess_logged_in(struct se_session *);\n" | ||
| 843 | |||
| 844 | if re.search('sess_get_index\)\(', fo): | 820 | if re.search('sess_get_index\)\(', fo): |
| 845 | buf += "u32 " + fabric_mod_name + "_sess_get_index(struct se_session *se_sess)\n" | 821 | buf += "u32 " + fabric_mod_name + "_sess_get_index(struct se_session *se_sess)\n" |
| 846 | buf += "{\n" | 822 | buf += "{\n" |
| @@ -898,19 +874,18 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name): | |||
| 898 | bufi += "int " + fabric_mod_name + "_queue_status(struct se_cmd *);\n" | 874 | bufi += "int " + fabric_mod_name + "_queue_status(struct se_cmd *);\n" |
| 899 | 875 | ||
| 900 | if re.search('queue_tm_rsp\)\(', fo): | 876 | if re.search('queue_tm_rsp\)\(', fo): |
| 901 | buf += "int " + fabric_mod_name + "_queue_tm_rsp(struct se_cmd *se_cmd)\n" | 877 | buf += "void " + fabric_mod_name + "_queue_tm_rsp(struct se_cmd *se_cmd)\n" |
| 902 | buf += "{\n" | 878 | buf += "{\n" |
| 903 | buf += " return 0;\n" | 879 | buf += " return;\n" |
| 904 | buf += "}\n\n" | 880 | buf += "}\n\n" |
| 905 | bufi += "int " + fabric_mod_name + "_queue_tm_rsp(struct se_cmd *);\n" | 881 | bufi += "void " + fabric_mod_name + "_queue_tm_rsp(struct se_cmd *);\n" |
| 906 | 882 | ||
| 907 | if re.search('is_state_remove\)\(', fo): | 883 | if re.search('aborted_task\)\(', fo): |
| 908 | buf += "int " + fabric_mod_name + "_is_state_remove(struct se_cmd *se_cmd)\n" | 884 | buf += "void " + fabric_mod_name + "_aborted_task(struct se_cmd *se_cmd)\n" |
| 909 | buf += "{\n" | 885 | buf += "{\n" |
| 910 | buf += " return 0;\n" | 886 | buf += " return;\n" |
| 911 | buf += "}\n\n" | 887 | buf += "}\n\n" |
| 912 | bufi += "int " + fabric_mod_name + "_is_state_remove(struct se_cmd *);\n" | 888 | bufi += "void " + fabric_mod_name + "_aborted_task(struct se_cmd *);\n" |
| 913 | |||
| 914 | 889 | ||
| 915 | ret = p.write(buf) | 890 | ret = p.write(buf) |
| 916 | if ret: | 891 | if ret: |
| @@ -1018,11 +993,11 @@ def main(modname, proto_ident): | |||
| 1018 | tcm_mod_build_kbuild(fabric_mod_dir, fabric_mod_name) | 993 | tcm_mod_build_kbuild(fabric_mod_dir, fabric_mod_name) |
| 1019 | tcm_mod_build_kconfig(fabric_mod_dir, fabric_mod_name) | 994 | tcm_mod_build_kconfig(fabric_mod_dir, fabric_mod_name) |
| 1020 | 995 | ||
| 1021 | input = raw_input("Would you like to add " + fabric_mod_name + "to drivers/target/Makefile..? [yes,no]: ") | 996 | input = raw_input("Would you like to add " + fabric_mod_name + " to drivers/target/Makefile..? [yes,no]: ") |
| 1022 | if input == "yes" or input == "y": | 997 | if input == "yes" or input == "y": |
| 1023 | tcm_mod_add_kbuild(tcm_dir, fabric_mod_name) | 998 | tcm_mod_add_kbuild(tcm_dir, fabric_mod_name) |
| 1024 | 999 | ||
| 1025 | input = raw_input("Would you like to add " + fabric_mod_name + "to drivers/target/Kconfig..? [yes,no]: ") | 1000 | input = raw_input("Would you like to add " + fabric_mod_name + " to drivers/target/Kconfig..? [yes,no]: ") |
| 1026 | if input == "yes" or input == "y": | 1001 | if input == "yes" or input == "y": |
| 1027 | tcm_mod_add_kconfig(tcm_dir, fabric_mod_name) | 1002 | tcm_mod_add_kconfig(tcm_dir, fabric_mod_name) |
| 1028 | 1003 | ||
