+void cxgbi_fill_iscsi_transport(struct iscsi_transport *itp)
+{
+ /* owner and name should be set already */
+ itp->caps = CAP_RECOVERY_L0 | CAP_MULTI_R2T | CAP_HDRDGST
+ | CAP_DATADGST | CAP_DIGEST_OFFLOAD |
+ CAP_PADDING_OFFLOAD;
+ itp->param_mask = ISCSI_MAX_RECV_DLENGTH |
+ ISCSI_MAX_XMIT_DLENGTH |
+ ISCSI_HDRDGST_EN |
+ ISCSI_DATADGST_EN |
+ ISCSI_INITIAL_R2T_EN |
+ ISCSI_MAX_R2T |
+ ISCSI_IMM_DATA_EN |
+ ISCSI_FIRST_BURST |
+ ISCSI_MAX_BURST |
+ ISCSI_PDU_INORDER_EN |
+ ISCSI_DATASEQ_INORDER_EN |
+ ISCSI_ERL |
+ ISCSI_CONN_PORT |
+ ISCSI_CONN_ADDRESS |
+ ISCSI_EXP_STATSN |
+ ISCSI_PERSISTENT_PORT |
+ ISCSI_PERSISTENT_ADDRESS |
+ ISCSI_TARGET_NAME | ISCSI_TPGT |
+ ISCSI_USERNAME | ISCSI_PASSWORD |
+ ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN |
+ ISCSI_FAST_ABORT | ISCSI_ABORT_TMO |
+ ISCSI_LU_RESET_TMO | ISCSI_TGT_RESET_TMO |
+ ISCSI_PING_TMO | ISCSI_RECV_TMO |
+ ISCSI_IFACE_NAME | ISCSI_INITIATOR_NAME;
+ itp->host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS |
+ ISCSI_HOST_INITIATOR_NAME |
+ ISCSI_HOST_NETDEV_NAME;
+ itp->get_host_param = cxgbi_get_host_param;
+ itp->set_host_param = cxgbi_set_host_param;
+ /* session management */
+ itp->create_session = cxgbi_create_session;
+ itp->destroy_session = cxgbi_destroy_session;
+ itp->get_session_param = iscsi_session_get_param;
+ /* connection management */
+ itp->create_conn = cxgbi_create_conn;
+ itp->bind_conn = cxgbi_bind_conn;
+ itp->destroy_conn = iscsi_tcp_conn_teardown;
+ itp->start_conn = iscsi_conn_start;
+ itp->stop_conn = iscsi_conn_stop;
+ itp->get_conn_param = cxgbi_get_conn_param;
+ itp->set_param = cxgbi_set_conn_param;
+ itp->get_stats = cxgbi_get_conn_stats;
+ /* pdu xmit reqitp-> from user space */
+ itp->send_pdu = iscsi_conn_send_pdu;
+ /* task */
+ itp->init_task = iscsi_tcp_task_init;
+ itp->xmit_task = iscsi_tcp_task_xmit;
+ itp->cleanup_task = cxgbi_cleanup_task;
+
+ /* pdu */
+ itp->alloc_pdu = cxgbi_conn_alloc_pdu;
+ itp->init_pdu = cxgbi_conn_init_pdu;
+ itp->xmit_pdu = cxgbi_conn_xmit_pdu;
+ itp->parse_pdu_itt = cxgbi_parse_pdu_itt;
+
+ /* TCP connect/disconnect */
+ itp->ep_connect = cxgbi_ep_connect;
+ itp->ep_poll = cxgbi_ep_poll;
+ itp->ep_disconnect = cxgbi_ep_disconnect;
+ /* Error recovery timeout call */
+ itp->session_recovery_timedout = iscsi_session_recovery_timedout;
+}
+EXPORT_SYMBOL_GPL(cxgbi_fill_iscsi_transport);
+
+void cxgbi_fill_scsi_host_template(struct scsi_host_template *sht)
+{
+ /*
+ * the following fields should be set already:
+ * module; name, proc_name, can_queue
+ */
+ sht->queuecommand = iscsi_queuecommand;
+ sht->change_queue_depth = iscsi_change_queue_depth;
+ sht->sg_tablesize = SG_ALL;
+ sht->max_sectors = 0xFFFF;
+ sht->cmd_per_lun = ISCSI_DEF_CMD_PER_LUN;
+ sht->eh_abort_handler = iscsi_eh_abort;
+ sht->eh_device_reset_handler = iscsi_eh_device_reset;
+ sht->eh_target_reset_handler = iscsi_eh_recover_target;
+ sht->target_alloc = iscsi_target_alloc;
+ sht->use_clustering = DISABLE_CLUSTERING;
+ sht->this_id = -1;
+}
+EXPORT_SYMBOL_GPL(cxgbi_fill_scsi_host_template);
+