Hi Mike, Attached is patch for libiscsi/libiscsi_tcp to support cxgb3i on RHEL-5.{,0,1,3} and SLES 10 and it applied on top of 2.6.14-23_compat.patch. Its based on your work for RHEL-5.4. I have run the regression test on mentioned platform and it worked without any problem. If you find it okay, then I will send the final patch with little bit more cleanup and needed Makefile changes.
Regards Rakesh Ranjan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "open-iscsi" group. To post to this group, send email to open-iscsi@googlegroups.com To unsubscribe from this group, send email to open-iscsi+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/open-iscsi -~----------~----~----~----~------~----~------~--~---
diff -Nuarp a/iscsi_tcp.c b/iscsi_tcp.c --- a/iscsi_tcp.c 2009-08-31 18:32:05.000000000 +0530 +++ b/iscsi_tcp.c 2009-08-31 18:33:16.000000000 +0530 @@ -254,6 +254,8 @@ static int iscsi_sw_tcp_xmit_segment(str if (r < 0) { iscsi_tcp_segment_unmap(segment); + if (copied || r == -EAGAIN) + break; return r; } copied += r; @@ -274,17 +276,11 @@ static int iscsi_sw_tcp_xmit(struct iscs while (1) { rc = iscsi_sw_tcp_xmit_segment(tcp_conn, segment); - /* - * We may not have been able to send data because the conn - * is getting stopped. libiscsi will know so propogate err - * for it to do the right thing. - */ - if (rc == -EAGAIN) - return rc; - else if (rc < 0) { + if (rc < 0) { rc = ISCSI_ERR_XMIT_FAILED; goto error; - } else if (rc == 0) + } + if (rc == 0) break; consumed += rc; @@ -465,10 +461,9 @@ static int iscsi_sw_tcp_pdu_init(struct offset, count); } - if (err) { + if (err) /* got invalid offset/len */ - return -EIO; - } + return -EINVAL; return 0; } @@ -607,22 +602,14 @@ static int iscsi_sw_tcp_get_addr(struct case AF_INET: sin = (struct sockaddr_in *)addr; spin_lock_bh(&conn->session->lock); -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28) - sprintf(buf, "%pI4", &sin->sin_addr.s_addr); -#else sprintf(buf, NIPQUAD_FMT, NIPQUAD(sin->sin_addr.s_addr)); -#endif *port = be16_to_cpu(sin->sin_port); spin_unlock_bh(&conn->session->lock); break; case AF_INET6: sin6 = (struct sockaddr_in6 *)addr; spin_lock_bh(&conn->session->lock); -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28) - sprintf(buf, "%pI6", &sin6->sin6_addr); -#else sprintf(buf, NIP6_FMT, NIP6(sin6->sin6_addr)); -#endif *port = be16_to_cpu(sin6->sin6_port); spin_unlock_bh(&conn->session->lock); break; @@ -795,11 +782,7 @@ iscsi_sw_tcp_session_create(struct iscsi shost->max_lun = iscsi_max_lun; shost->max_id = 0; shost->max_channel = 0; -#ifndef SCSI_MAX_VARLEN_CDB_SIZE - shost->max_cmd_len = 16; -#else shost->max_cmd_len = SCSI_MAX_VARLEN_CDB_SIZE; -#endif if (iscsi_host_add(shost, NULL)) goto free_host; @@ -846,9 +829,6 @@ static int iscsi_sw_tcp_slave_configure( } static struct scsi_host_template iscsi_sw_tcp_sht = { -#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,24) - .use_sg_chaining = ENABLE_SG_CHAINING, -#endif .module = THIS_MODULE, .name = "iSCSI Initiator over TCP/IP", .queuecommand = iscsi_queuecommand, @@ -862,7 +842,6 @@ static struct scsi_host_template iscsi_s .eh_host_reset_handler = iscsi_eh_target_reset, .use_clustering = DISABLE_CLUSTERING, .slave_configure = iscsi_sw_tcp_slave_configure, - .target_alloc = iscsi_target_alloc, .proc_name = "iscsi_tcp", .this_id = -1, }; diff -Nuarp a/libiscsi.c b/libiscsi.c --- a/libiscsi.c 2009-08-31 18:32:05.000000000 +0530 +++ b/libiscsi.c 2009-08-31 18:33:16.000000000 +0530 @@ -25,9 +25,6 @@ #include <linux/kfifo.h> #include <linux/delay.h> #include <linux/version.h> -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,19) -#include <linux/log2.h> -#endif #include <asm/unaligned.h> #include <net/tcp.h> #include <scsi/scsi_cmnd.h> @@ -41,30 +38,15 @@ #include "scsi_transport_iscsi.h" #include "libiscsi.h" -static int iscsi_dbg_lib_conn; -module_param_named(debug_libiscsi_conn, iscsi_dbg_lib_conn, int, - S_IRUGO | S_IWUSR); -MODULE_PARM_DESC(debug_libiscsi_conn, - "Turn on debugging for connections in libiscsi module. " - "Set to 1 to turn on, and zero to turn off. Default is off."); - -static int iscsi_dbg_lib_session; -module_param_named(debug_libiscsi_session, iscsi_dbg_lib_session, int, - S_IRUGO | S_IWUSR); -MODULE_PARM_DESC(debug_libiscsi_session, - "Turn on debugging for sessions in libiscsi module. " - "Set to 1 to turn on, and zero to turn off. Default is off."); - -static int iscsi_dbg_lib_eh; -module_param_named(debug_libiscsi_eh, iscsi_dbg_lib_eh, int, - S_IRUGO | S_IWUSR); -MODULE_PARM_DESC(debug_libiscsi_eh, - "Turn on debugging for error handling in libiscsi module. " - "Set to 1 to turn on, and zero to turn off. Default is off."); +static int iscsi_dbg_lib; +module_param_named(debug_libiscsi, iscsi_dbg_lib, int, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(debug_libiscsi, "Turn on debugging for libiscsi module. " + "Set to 1 to turn on, and zero to turn off. Default " + "is off."); #define ISCSI_DBG_CONN(_conn, dbg_fmt, arg...) \ do { \ - if (iscsi_dbg_lib_conn) \ + if (iscsi_dbg_lib) \ iscsi_conn_printk(KERN_INFO, _conn, \ "%s " dbg_fmt, \ __func__, ##arg); \ @@ -72,22 +54,12 @@ MODULE_PARM_DESC(debug_libiscsi_eh, #define ISCSI_DBG_SESSION(_session, dbg_fmt, arg...) \ do { \ - if (iscsi_dbg_lib_session) \ + if (iscsi_dbg_lib) \ iscsi_session_printk(KERN_INFO, _session, \ "%s " dbg_fmt, \ __func__, ##arg); \ } while (0); -#define ISCSI_DBG_EH(_session, dbg_fmt, arg...) \ - do { \ - if (iscsi_dbg_lib_eh) \ - iscsi_session_printk(KERN_INFO, _session, \ - "%s " dbg_fmt, \ - __func__, ##arg); \ - } while (0); - -#include "open_iscsi_compat.h" - /* Serial Number Arithmetic, 32 bits, less than, RFC1982 */ #define SNA32_CHECK 2147483648UL @@ -397,13 +369,13 @@ static int iscsi_prep_scsi_cmd_pdu(struc conn->scsicmd_pdus_cnt++; ISCSI_DBG_SESSION(session, "iscsi prep [%s cid %d sc %p cdb 0x%x " "itt 0x%x len %d bidi_len %d cmdsn %d win %d]\n", - scsi_bidi_cmnd(sc) ? "bidirectional" : - sc->sc_data_direction == DMA_TO_DEVICE ? - "write" : "read", conn->id, sc, sc->cmnd[0], - task->itt, scsi_bufflen(sc), - scsi_bidi_cmnd(sc) ? scsi_bufflen(sc) : 0, - session->cmdsn, - session->max_cmdsn - session->exp_cmdsn + 1); + scsi_bidi_cmnd(sc) ? "bidirectional" : + sc->sc_data_direction == DMA_TO_DEVICE ? + "write" : "read", conn->id, sc, sc->cmnd[0], + task->itt, scsi_bufflen(sc), + scsi_bidi_cmnd(sc) ? scsi_bufflen(sc) : 0, + session->cmdsn, + session->max_cmdsn - session->exp_cmdsn + 1); return 0; } @@ -977,7 +949,6 @@ int __iscsi_complete_pdu(struct iscsi_co task = iscsi_itt_to_ctask(conn, hdr->itt); if (!task) return ISCSI_ERR_BAD_ITT; - task->last_xfer = jiffies; break; case ISCSI_OP_R2T: /* @@ -1216,12 +1187,10 @@ static int iscsi_xmit_task(struct iscsi_ spin_unlock_bh(&conn->session->lock); rc = conn->session->tt->xmit_task(task); spin_lock_bh(&conn->session->lock); - if (!rc) { + __iscsi_put_task(task); + if (!rc) /* done with this task */ - task->last_xfer = jiffies; conn->task = NULL; - } - __iscsi_put_task(task); return rc; } @@ -1387,9 +1356,6 @@ static inline struct iscsi_task *iscsi_a task->state = ISCSI_TASK_PENDING; task->conn = conn; task->sc = sc; - task->have_checked_conn = 0; - task->last_timeout = jiffies; - task->last_xfer = jiffies; INIT_LIST_HEAD(&task->running); return task; } @@ -1518,7 +1484,13 @@ reject: ISCSI_DBG_SESSION(session, "cmd 0x%x rejected (%d)\n", sc->cmnd[0], reason); spin_lock(host->host_lock); - return SCSI_MLQUEUE_HOST_BUSY; + /* + * we want to return SCSI_MLQUEUE_TARGET_BUSY but the backport + * is too risky. Instead we return device busy which will force + * this to get called for each device, but host busy would stop + * traffic on all sessions which would be worse. + */ + return SCSI_MLQUEUE_DEVICE_BUSY; prepd_fault: sc->scsi_done = NULL; @@ -1541,18 +1513,6 @@ int iscsi_change_queue_depth(struct scsi } EXPORT_SYMBOL_GPL(iscsi_change_queue_depth); -int iscsi_target_alloc(struct scsi_target *starget) -{ - struct iscsi_cls_session *cls_session = starget_to_session(starget); - struct iscsi_session *session = cls_session->dd_data; - -#if 0 - starget->can_queue = session->scsi_cmds_max; -#endif - return 0; -} -EXPORT_SYMBOL_GPL(iscsi_target_alloc); - void iscsi_session_recovery_timedout(struct iscsi_cls_session *cls_session) { struct iscsi_session *session = cls_session->dd_data; @@ -1567,13 +1527,11 @@ void iscsi_session_recovery_timedout(str } EXPORT_SYMBOL_GPL(iscsi_session_recovery_timedout); -int iscsi_eh_target_reset(struct scsi_cmnd *sc) +int iscsi_target_reset(struct iscsi_cls_session *cls_session) { - struct iscsi_cls_session *cls_session; struct iscsi_session *session; struct iscsi_conn *conn; - cls_session = starget_to_session(scsi_target(sc->device)); session = cls_session->dd_data; conn = session->leadconn; @@ -1581,10 +1539,10 @@ int iscsi_eh_target_reset(struct scsi_cm spin_lock_bh(&session->lock); if (session->state == ISCSI_STATE_TERMINATE) { failed: - ISCSI_DBG_EH(session, - "failing target reset: Could not log back into " - "target [age %d]\n", - session->age); + iscsi_session_printk(KERN_INFO, session, + "failing target reset: Could not log " + "back into target [age %d]\n", + session->age); spin_unlock_bh(&session->lock); mutex_unlock(&session->eh_mutex); return FAILED; @@ -1598,7 +1556,7 @@ failed: */ iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); - ISCSI_DBG_EH(session, "wait for relogin\n"); + ISCSI_DBG_SESSION(session, "wait for relogin\n"); wait_event_interruptible(conn->ehwait, session->state == ISCSI_STATE_TERMINATE || session->state == ISCSI_STATE_LOGGED_IN || @@ -1608,15 +1566,24 @@ failed: mutex_lock(&session->eh_mutex); spin_lock_bh(&session->lock); - if (session->state == ISCSI_STATE_LOGGED_IN) { - ISCSI_DBG_EH(session, - "target reset succeeded\n"); - } else + if (session->state == ISCSI_STATE_LOGGED_IN) + iscsi_session_printk(KERN_INFO, session, + "target reset succeeded\n"); + else goto failed; spin_unlock_bh(&session->lock); mutex_unlock(&session->eh_mutex); return SUCCESS; } +EXPORT_SYMBOL_GPL(iscsi_target_reset); + +int iscsi_eh_target_reset(struct scsi_cmnd *sc) +{ + struct iscsi_cls_session *cls_session; + + cls_session = starget_to_session(scsi_target(sc->device)); + return iscsi_target_reset(cls_session); +} EXPORT_SYMBOL_GPL(iscsi_eh_target_reset); static void iscsi_tmf_timedout(unsigned long data) @@ -1627,7 +1594,7 @@ static void iscsi_tmf_timedout(unsigned spin_lock(&session->lock); if (conn->tmf_state == TMF_QUEUED) { conn->tmf_state = TMF_TIMEDOUT; - ISCSI_DBG_EH(session, "tmf timedout\n"); + ISCSI_DBG_SESSION(session, "tmf timedout\n"); /* unblock eh_abort() */ wake_up(&conn->ehwait); } @@ -1647,7 +1614,7 @@ static int iscsi_exec_task_mgmt_fn(struc spin_unlock_bh(&session->lock); iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); spin_lock_bh(&session->lock); - ISCSI_DBG_EH(session, "tmf exec failure\n"); + ISCSI_DBG_SESSION(session, "tmf exec failure\n"); return -EPERM; } conn->tmfcmd_pdus_cnt++; @@ -1655,7 +1622,7 @@ static int iscsi_exec_task_mgmt_fn(struc conn->tmf_timer.function = iscsi_tmf_timedout; conn->tmf_timer.data = (unsigned long)conn; add_timer(&conn->tmf_timer); - ISCSI_DBG_EH(session, "tmf set timeout\n"); + ISCSI_DBG_SESSION(session, "tmf set timeout\n"); spin_unlock_bh(&session->lock); mutex_unlock(&session->eh_mutex); @@ -1742,18 +1709,17 @@ static int iscsi_has_ping_timed_out(stru return 0; } -static enum blk_eh_timer_return iscsi_eh_cmd_timed_out(struct scsi_cmnd *sc) +static enum blk_eh_timer_return iscsi_eh_cmd_timed_out(struct scsi_cmnd *scmd) { - enum blk_eh_timer_return rc = BLK_EH_NOT_HANDLED; - struct iscsi_task *task = NULL; struct iscsi_cls_session *cls_session; struct iscsi_session *session; struct iscsi_conn *conn; + enum blk_eh_timer_return rc = BLK_EH_NOT_HANDLED; - cls_session = starget_to_session(scsi_target(sc->device)); + cls_session = starget_to_session(scsi_target(scmd->device)); session = cls_session->dd_data; - ISCSI_DBG_EH(session, "scsi cmd %p timedout\n", sc); + ISCSI_DBG_SESSION(session, "scsi cmd %p timedout\n", scmd); spin_lock(&session->lock); if (session->state != ISCSI_STATE_LOGGED_IN) { @@ -1772,26 +1738,6 @@ static enum blk_eh_timer_return iscsi_eh goto done; } - task = (struct iscsi_task *)sc->SCp.ptr; - if (!task) - goto done; - /* - * If we have sent (at least queued to the network layer) a pdu or - * recvd one for the task since the last timeout ask for - * more time. If on the next timeout we have not made progress - * we can check if it is the task or connection when we send the - * nop as a ping. - */ - if (time_after_eq(task->last_xfer, task->last_timeout)) { - ISCSI_DBG_EH(session, "Command making progress. Asking " - "scsi-ml for more time to complete. " - "Last data recv at %lu. Last timeout was at " - "%lu\n.", task->last_xfer, task->last_timeout); - task->have_checked_conn = 0; - rc = BLK_EH_RESET_TIMER; - goto done; - } - if (!conn->recv_timeout && !conn->ping_timeout) goto done; /* @@ -1802,32 +1748,23 @@ static enum blk_eh_timer_return iscsi_eh rc = BLK_EH_RESET_TIMER; goto done; } - - /* Assumes nop timeout is shorter than scsi cmd timeout */ - if (task->have_checked_conn) - goto done; - /* - * Checking the transport already or nop from a cmd timeout still - * running + * if we are about to check the transport then give the command + * more time */ - if (conn->ping_task) { - task->have_checked_conn = 1; + if (time_before_eq(conn->last_recv + (conn->recv_timeout * HZ), + jiffies)) { rc = BLK_EH_RESET_TIMER; goto done; } - /* Make sure there is a transport check done */ - iscsi_send_nopout(conn, NULL); - task->have_checked_conn = 1; - rc = BLK_EH_RESET_TIMER; - + /* if in the middle of checking the transport then give us more time */ + if (conn->ping_task) + rc = BLK_EH_RESET_TIMER; done: - if (task) - task->last_timeout = jiffies; spin_unlock(&session->lock); - ISCSI_DBG_EH(session, "return %s\n", rc == BLK_EH_RESET_TIMER ? - "timer reset" : "nh"); + ISCSI_DBG_SESSION(session, "return %s\n", rc == BLK_EH_RESET_TIMER ? + "timer reset" : "nh"); return rc; } @@ -1897,7 +1834,7 @@ int iscsi_eh_abort(struct scsi_cmnd *sc) cls_session = starget_to_session(scsi_target(sc->device)); session = cls_session->dd_data; - ISCSI_DBG_EH(session, "aborting sc %p\n", sc); + ISCSI_DBG_SESSION(session, "aborting sc %p\n", sc); mutex_lock(&session->eh_mutex); spin_lock_bh(&session->lock); @@ -1906,8 +1843,8 @@ int iscsi_eh_abort(struct scsi_cmnd *sc) * got the command. */ if (!sc->SCp.ptr) { - ISCSI_DBG_EH(session, "sc never reached iscsi layer or " - "it completed.\n"); + ISCSI_DBG_SESSION(session, "sc never reached iscsi layer or " + "it completed.\n"); spin_unlock_bh(&session->lock); mutex_unlock(&session->eh_mutex); return SUCCESS; @@ -1921,7 +1858,7 @@ int iscsi_eh_abort(struct scsi_cmnd *sc) sc->SCp.phase != session->age) { spin_unlock_bh(&session->lock); mutex_unlock(&session->eh_mutex); - ISCSI_DBG_EH(session, "failing abort due to dropped " + ISCSI_DBG_SESSION(session, "failing abort due to dropped " "session.\n"); return FAILED; } @@ -1931,12 +1868,13 @@ int iscsi_eh_abort(struct scsi_cmnd *sc) age = session->age; task = (struct iscsi_task *)sc->SCp.ptr; - ISCSI_DBG_EH(session, "aborting [sc %p itt 0x%x]\n", - sc, task->itt); + ISCSI_DBG_SESSION(session, "aborting [sc %p itt 0x%x]\n", + sc, task->itt); /* task completed before time out */ if (!task->sc) { - ISCSI_DBG_EH(session, "sc completed while abort in progress\n"); + ISCSI_DBG_SESSION(session, "sc completed while abort in " + "progress\n"); goto success; } @@ -1985,8 +1923,8 @@ int iscsi_eh_abort(struct scsi_cmnd *sc) if (!sc->SCp.ptr) { conn->tmf_state = TMF_INITIAL; /* task completed before tmf abort response */ - ISCSI_DBG_EH(session, "sc completed while abort in " - "progress\n"); + ISCSI_DBG_SESSION(session, "sc completed while abort " + "in progress\n"); goto success; } /* fall through */ @@ -1998,16 +1936,16 @@ int iscsi_eh_abort(struct scsi_cmnd *sc) success: spin_unlock_bh(&session->lock); success_unlocked: - ISCSI_DBG_EH(session, "abort success [sc %p itt 0x%x]\n", - sc, task->itt); + ISCSI_DBG_SESSION(session, "abort success [sc %p itt 0x%x]\n", + sc, task->itt); mutex_unlock(&session->eh_mutex); return SUCCESS; failed: spin_unlock_bh(&session->lock); failed_unlocked: - ISCSI_DBG_EH(session, "abort failed [sc %p itt 0x%x]\n", sc, - task ? task->itt : 0); + ISCSI_DBG_SESSION(session, "abort failed [sc %p itt 0x%x]\n", sc, + task ? task->itt : 0); mutex_unlock(&session->eh_mutex); return FAILED; } @@ -2034,7 +1972,8 @@ int iscsi_eh_device_reset(struct scsi_cm cls_session = starget_to_session(scsi_target(sc->device)); session = cls_session->dd_data; - ISCSI_DBG_EH(session, "LU Reset [sc %p lun %u]\n", sc, sc->device->lun); + ISCSI_DBG_SESSION(session, "LU Reset [sc %p lun %u]\n", + sc, sc->device->lun); mutex_lock(&session->eh_mutex); spin_lock_bh(&session->lock); @@ -2088,8 +2027,8 @@ int iscsi_eh_device_reset(struct scsi_cm unlock: spin_unlock_bh(&session->lock); done: - ISCSI_DBG_EH(session, "dev reset result = %s\n", - rc == SUCCESS ? "SUCCESS" : "FAILED"); + ISCSI_DBG_SESSION(session, "dev reset result = %s\n", + rc == SUCCESS ? "SUCCESS" : "FAILED"); mutex_unlock(&session->eh_mutex); return rc; } diff -Nuarp a/libiscsi.h b/libiscsi.h --- a/libiscsi.h 2009-08-31 18:32:05.000000000 +0530 +++ b/libiscsi.h 2009-08-31 18:33:16.000000000 +0530 @@ -26,8 +26,6 @@ #include <linux/types.h> #include <linux/wait.h> #include <linux/mutex.h> -#include <linux/timer.h> -#include <linux/workqueue.h> #include "iscsi_proto.h" #include "iscsi_if.h" #include "scsi_transport_iscsi.h" @@ -38,7 +36,6 @@ struct scsi_transport_template; struct scsi_host_template; struct scsi_device; struct Scsi_Host; -struct scsi_target; struct scsi_cmnd; struct socket; struct iscsi_transport; @@ -127,10 +124,6 @@ struct iscsi_task { struct scsi_cmnd *sc; /* associated SCSI cmd*/ struct iscsi_conn *conn; /* used connection */ - /* data processing tracking */ - unsigned long last_xfer; - unsigned long last_timeout; - int have_checked_conn; /* state set/tested under session->lock */ int state; atomic_t refcount; @@ -337,6 +330,7 @@ struct iscsi_host { extern int iscsi_change_queue_depth(struct scsi_device *sdev, int depth); extern int iscsi_eh_abort(struct scsi_cmnd *sc); extern int iscsi_eh_target_reset(struct scsi_cmnd *sc); +extern int iscsi_target_reset(struct iscsi_cls_session *cls_session); extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); extern int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)); @@ -358,7 +352,6 @@ extern struct Scsi_Host *iscsi_host_allo bool xmit_can_sleep); extern void iscsi_host_remove(struct Scsi_Host *shost); extern void iscsi_host_free(struct Scsi_Host *shost); -extern int iscsi_target_alloc(struct scsi_target *starget); /* * session management diff -Nuarp a/libiscsi_tcp.c b/libiscsi_tcp.c --- a/libiscsi_tcp.c 2009-08-31 18:32:05.000000000 +0530 +++ b/libiscsi_tcp.c 2009-08-31 18:33:16.000000000 +0530 @@ -40,9 +40,9 @@ #include <scsi/scsi_device.h> #include <scsi/scsi_host.h> #include <scsi/scsi.h> +#include "open_iscsi_compat.h" #include "scsi_transport_iscsi.h" - -#include "iscsi_tcp.h" +#include "libiscsi_tcp.h" MODULE_AUTHOR("Mike Christie <micha...@cs.wisc.edu>, " "Dmitry Yusupov <dmitry_...@yahoo.com>, " @@ -695,7 +695,6 @@ iscsi_tcp_hdr_dissect(struct iscsi_conn "offset=%d, datalen=%d)\n", tcp_task->data_offset, tcp_conn->in.datalen); - task->last_xfer = jiffies; rc = iscsi_segment_seek_sg(&tcp_conn->in.segment, scsi_sglist(task->sc), scsi_sg_count(task->sc), @@ -723,10 +722,9 @@ iscsi_tcp_hdr_dissect(struct iscsi_conn rc = ISCSI_ERR_BAD_ITT; else if (ahslen) rc = ISCSI_ERR_AHSLEN; - else if (task->sc->sc_data_direction == DMA_TO_DEVICE) { - task->last_xfer = jiffies; + else if (task->sc->sc_data_direction == DMA_TO_DEVICE) rc = iscsi_tcp_r2t_rsp(conn, task); - } else + else rc = ISCSI_ERR_PROTO; spin_unlock(&conn->session->lock); break; diff -Nuarp a/libiscsi_tcp.h b/libiscsi_tcp.h --- a/libiscsi_tcp.h 2009-08-31 18:32:05.000000000 +0530 +++ b/libiscsi_tcp.h 2009-08-31 18:33:16.000000000 +0530 @@ -21,7 +21,6 @@ #ifndef LIBISCSI_TCP_H #define LIBISCSI_TCP_H -#include "open_iscsi_compat.h" #include "libiscsi.h" struct iscsi_tcp_conn; diff -Nuarp a/open_iscsi_compat.h b/open_iscsi_compat.h --- a/open_iscsi_compat.h 2009-08-31 18:32:05.000000000 +0530 +++ b/open_iscsi_compat.h 2009-08-31 18:33:16.000000000 +0530 @@ -5,6 +5,7 @@ #include <linux/kernel.h> #include <scsi/scsi.h> #include <scsi/scsi_cmnd.h> +#include <scsi/scsi_host.h> #ifndef SCAN_WILD_CARD #define SCAN_WILD_CARD ~0 @@ -28,7 +29,8 @@ #define mutex_init init_MUTEX #endif -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,19) +#if 0 +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,19) struct delayed_work { struct work_struct work; }; @@ -45,6 +47,16 @@ static inline void INIT_WORK_compat(stru #define INIT_DELAYED_WORK(_work,_func) INIT_WORK(&(_work)->work, _func) #endif +#endif + +static inline void INIT_WORK_compat(struct work_struct *work, void *func) +{ + INIT_WORK(work, func, work); +} + +#undef INIT_WORK +#define INIT_WORK(_work, _func) INIT_WORK_compat(_work, _func) +#define INIT_DELAYED_WORK(_work,_func) INIT_WORK_compat(_work, _func) #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,12) @@ -66,7 +78,8 @@ void int_to_scsilun(unsigned int lun, st #endif -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,13) +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,13) && \ + RHEL_RELEASE_CODE != RHEL_RELEASE_VERSION(4,8) #define gfp_t unsigned @@ -83,6 +96,7 @@ void *kzalloc(size_t size, gfp_t flags) #include "linux/crypto.h" +#if !defined SLE_VERSION_CODE #define CRYPTO_ALG_ASYNC 0x00000080 struct hash_desc { @@ -129,19 +143,22 @@ static inline void crypto_free_hash(stru { crypto_free_tfm(tfm); } - -int kernel_getsockname(struct socket *sock, struct sockaddr *addr, +#endif +#ifdef RHEL_RELEASE_VERSION +#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5,1) +static inline int kernel_getsockname(struct socket *sock, struct sockaddr *addr, int *addrlen) { return sock->ops->getname(sock, addr, addrlen, 0); } -int kernel_getpeername(struct socket *sock, struct sockaddr *addr, +static inline int kernel_getpeername(struct socket *sock, struct sockaddr *addr, int *addrlen) { return sock->ops->getname(sock, addr, addrlen, 1); } - +#endif +#endif #endif #ifndef bool @@ -150,7 +167,8 @@ int kernel_getpeername(struct socket *so #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20) #ifdef RHEL_RELEASE_VERSION -#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5,2) +#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5,2) && \ + RHEL_RELEASE_CODE != RHEL_RELEASE_VERSION(4,8) static inline int is_power_of_2(unsigned long n) { return (n != 0 && ((n & (n - 1)) == 0)); @@ -227,6 +245,19 @@ static inline int scsi_get_resid(struct #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23) +#ifdef SLE_VERSION_CODE +#if SLE_VERSION_CODE == SLE_VERSION(10,2,0) + +static inline unsigned fls_long(unsigned long l) +{ + if (sizeof(l) == 4) + return fls(l); + return fls64(l); +} + +#endif +#endif + static inline unsigned long rounddown_pow_of_two(unsigned long n) { return 1UL << (fls_long(n) - 1); @@ -271,16 +302,14 @@ static inline int scsi_bidi_cmnd(struct #define netlink_kernel_release(_nls) \ sock_release(_nls->sk_socket) - #endif - #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,13) #define netlink_kernel_create(net, uint, groups, input, cb_mutex, mod) \ - netlink_kernel_create(uint, input) + netlink_kernel_create(uint, groups, input, cb_mutex, mod) -#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,21) +#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,19) #define netlink_kernel_create(net, uint, groups, input, cb_mutex, mod) \ netlink_kernel_create(uint, groups, input, mod) @@ -318,4 +347,11 @@ static inline int scsi_bidi_cmnd(struct #endif +#define SCSI_MAX_VARLEN_CDB_SIZE 16 + +/* read from target, no bidi support */ +#define is_read_command(sc) (sc->sc_data_direction == DMA_FROM_DEVICE) + +#define ISCSI_NL_GRP_ISCSID 1 + #endif diff -Nuarp a/scsi_transport_iscsi.c b/scsi_transport_iscsi.c --- a/scsi_transport_iscsi.c 2009-08-31 18:32:05.000000000 +0530 +++ b/scsi_transport_iscsi.c 2009-08-31 18:33:16.000000000 +0530 @@ -21,6 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <linux/module.h> +#include <linux/version.h> #include <linux/mutex.h> #include <net/tcp.h> #include <scsi/scsi.h> @@ -37,7 +38,6 @@ #define ISCSI_TRANSPORT_VERSION "2.0-871" struct iscsi_internal { - int daemon_pid; struct scsi_transport_template t; struct iscsi_transport *iscsi_transport; struct list_head list; @@ -111,7 +111,6 @@ static struct attribute_group iscsi_tran .attrs = iscsi_transport_attrs, }; -#if 0 /* * iSCSI endpoint attrs */ @@ -122,27 +121,28 @@ static struct attribute_group iscsi_tran struct device_attribute dev_attr_##_prefix##_##_name = \ __ATTR(_name,_mode,_show,_store) -static void iscsi_endpoint_release(struct device *dev) +static void iscsi_endpoint_release(struct class_device *cdev) { - struct iscsi_endpoint *ep = iscsi_dev_to_endpoint(dev); + struct iscsi_endpoint *ep = iscsi_dev_to_endpoint(cdev); kfree(ep); } static struct class iscsi_endpoint_class = { .name = "iscsi_endpoint", - .dev_release = iscsi_endpoint_release, + .release = iscsi_endpoint_release, }; static ssize_t -show_ep_handle(struct device *dev, struct device_attribute *attr, char *buf) +show_ep_handle(struct class_device *cdev, char *buf) { - struct iscsi_endpoint *ep = iscsi_dev_to_endpoint(dev); + struct iscsi_endpoint *ep = iscsi_dev_to_endpoint(cdev); return sprintf(buf, "%llu\n", (unsigned long long) ep->id); } -static ISCSI_ATTR(ep, handle, S_IRUGO, show_ep_handle, NULL); +static struct class_device_attribute class_device_attr_ep_handle = + __ATTR(handle, S_IRUGO, show_ep_handle, NULL); static struct attribute *iscsi_endpoint_attrs[] = { - &dev_attr_ep_handle.attr, + &class_device_attr_ep_handle.attr, NULL, }; @@ -152,26 +152,32 @@ static struct attribute_group iscsi_endp #define ISCSI_MAX_EPID -1 -static int iscsi_match_epid(struct device *dev, void *data) +struct iscsi_endpoint *iscsi_lookup_endpoint(u64 handle) { - struct iscsi_endpoint *ep = iscsi_dev_to_endpoint(dev); - uint64_t *epid = (uint64_t *) data; + struct iscsi_endpoint *ep = NULL; + struct class_device *cdev; - return *epid == ep->id; + down_read(&iscsi_endpoint_class.subsys.rwsem); + list_for_each_entry(cdev, &iscsi_endpoint_class.children, node) { + ep = iscsi_dev_to_endpoint(cdev); + if (ep->id == handle) + break; + ep = NULL; + } + up_read(&iscsi_endpoint_class.subsys.rwsem); + return ep; } +EXPORT_SYMBOL_GPL(iscsi_lookup_endpoint); struct iscsi_endpoint * iscsi_create_endpoint(int dd_size) { - struct device *dev; struct iscsi_endpoint *ep; uint64_t id; int err; for (id = 1; id < ISCSI_MAX_EPID; id++) { - dev = class_find_device(&iscsi_endpoint_class, NULL, &id, - iscsi_match_epid); - if (!dev) + if (!iscsi_lookup_endpoint(id)) break; } if (id == ISCSI_MAX_EPID) { @@ -186,8 +192,9 @@ iscsi_create_endpoint(int dd_size) ep->id = id; ep->dev.class = &iscsi_endpoint_class; - dev_set_name(&ep->dev, "ep-%llu", (unsigned long long) id); - err = device_register(&ep->dev); + snprintf(ep->dev.class_id, BUS_ID_SIZE, "ep-%llu", + (unsigned long long) id); + err = class_device_register(&ep->dev); if (err) goto free_ep; @@ -200,7 +207,7 @@ iscsi_create_endpoint(int dd_size) return ep; unregister_dev: - device_unregister(&ep->dev); + class_device_unregister(&ep->dev); return NULL; free_ep: @@ -212,31 +219,10 @@ EXPORT_SYMBOL_GPL(iscsi_create_endpoint) void iscsi_destroy_endpoint(struct iscsi_endpoint *ep) { sysfs_remove_group(&ep->dev.kobj, &iscsi_endpoint_group); - device_unregister(&ep->dev); + class_device_unregister(&ep->dev); } EXPORT_SYMBOL_GPL(iscsi_destroy_endpoint); -struct iscsi_endpoint *iscsi_lookup_endpoint(u64 handle) -{ - struct iscsi_endpoint *ep; - struct device *dev; - - dev = class_find_device(&iscsi_endpoint_class, NULL, &handle, - iscsi_match_epid); - if (!dev) - return NULL; - - ep = iscsi_dev_to_endpoint(dev); - /* - * we can drop this now because the interface will prevent - * removals and lookups from racing. - */ - put_device(dev); - return ep; -} -EXPORT_SYMBOL_GPL(iscsi_lookup_endpoint); -#endif - static int iscsi_setup_host(struct transport_container *tc, struct device *dev, struct class_device *cdev) { @@ -404,25 +390,6 @@ void iscsi_host_for_each_session(struct } EXPORT_SYMBOL_GPL(iscsi_host_for_each_session); -/** - * iscsi_scan_finished - helper to report when running scans are done - * @shost: scsi host - * @time: scan run time - * - * This function can be used by drives like qla4xxx to report to the scsi - * layer when the scans it kicked off at module load time are done. - */ -int iscsi_scan_finished(struct Scsi_Host *shost, unsigned long time) -{ - struct iscsi_cls_host *ihost = shost->shost_data; - /* - * qla4xxx will have kicked off some session unblocks before calling - * scsi_scan_host, so just wait for them to complete. - */ - return !atomic_read(&ihost->nr_scans); -} -EXPORT_SYMBOL_GPL(iscsi_scan_finished); - struct iscsi_scan_data { unsigned int channel; unsigned int id; @@ -500,7 +467,7 @@ static void session_recovery_timedout(st { struct iscsi_cls_session *session = container_of(work, struct iscsi_cls_session, - recovery_work.work); + recovery_work); unsigned long flags; iscsi_cls_session_printk(KERN_INFO, session, @@ -531,8 +498,6 @@ static void __iscsi_unblock_session(stru struct iscsi_cls_session *session = container_of(work, struct iscsi_cls_session, unblock_work); - struct Scsi_Host *shost = iscsi_session_to_shost(session); - struct iscsi_cls_host *ihost = shost->shost_data; unsigned long flags; /* @@ -931,23 +896,17 @@ iscsi_if_transport_lookup(struct iscsi_t } static int -iscsi_broadcast_skb(struct sk_buff *skb, gfp_t gfp) +iscsi_multicast_skb(struct sk_buff *skb, u32 group, gfp_t gfp) { - return netlink_broadcast(nls, skb, 0, 1, gfp); -} + int err; -static int -iscsi_unicast_skb(struct sk_buff *skb, int pid) -{ - int rc; + NETLINK_CB(skb).dst_group = group; - rc = netlink_unicast(nls, skb, pid, MSG_DONTWAIT); - if (rc < 0) { - printk(KERN_ERR "iscsi: can not unicast skb (%d)\n", rc); - return rc; - } + err = netlink_broadcast(nls, skb, 0, group, gfp); + if (err > 0) + err = 0; - return 0; + return err; } int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, @@ -973,7 +932,7 @@ int iscsi_recv_pdu(struct iscsi_cls_conn return -ENOMEM; } - nlh = __nlmsg_put(skb, priv->daemon_pid, 0, 0, (len - sizeof(*nlh)), 0); + nlh = __nlmsg_put(skb, 0, 0, 0, (len - sizeof(*nlh)), 0); ev = NLMSG_DATA(nlh); memset(ev, 0, sizeof(*ev)); ev->transport_handle = iscsi_handle(conn->transport); @@ -984,7 +943,7 @@ int iscsi_recv_pdu(struct iscsi_cls_conn memcpy(pdu, hdr, sizeof(struct iscsi_hdr)); memcpy(pdu + sizeof(struct iscsi_hdr), data, data_size); - return iscsi_unicast_skb(skb, priv->daemon_pid); + return iscsi_multicast_skb(skb, ISCSI_NL_GRP_ISCSID, GFP_ATOMIC); } EXPORT_SYMBOL_GPL(iscsi_recv_pdu); @@ -1007,7 +966,7 @@ void iscsi_conn_error_event(struct iscsi return; } - nlh = __nlmsg_put(skb, priv->daemon_pid, 0, 0, (len - sizeof(*nlh)), 0); + nlh = __nlmsg_put(skb, 0, 0, 0, (len - sizeof(*nlh)), 0); ev = NLMSG_DATA(nlh); ev->transport_handle = iscsi_handle(conn->transport); ev->type = ISCSI_KEVENT_CONN_ERROR; @@ -1015,7 +974,7 @@ void iscsi_conn_error_event(struct iscsi ev->r.connerror.cid = conn->cid; ev->r.connerror.sid = iscsi_conn_get_sid(conn); - iscsi_broadcast_skb(skb, GFP_ATOMIC); + iscsi_multicast_skb(skb, ISCSI_NL_GRP_ISCSID, GFP_ATOMIC); iscsi_cls_conn_printk(KERN_INFO, conn, "detected conn error (%d)\n", error); @@ -1023,8 +982,8 @@ void iscsi_conn_error_event(struct iscsi EXPORT_SYMBOL_GPL(iscsi_conn_error_event); static int -iscsi_if_send_reply(int pid, int seq, int type, int done, int multi, - void *payload, int size) +iscsi_if_send_reply(u32 group, int seq, int type, int done, int multi, + void *payload, int size) { struct sk_buff *skb; struct nlmsghdr *nlh; @@ -1038,10 +997,10 @@ iscsi_if_send_reply(int pid, int seq, in return -ENOMEM; } - nlh = __nlmsg_put(skb, pid, seq, t, (len - sizeof(*nlh)), 0); + nlh = __nlmsg_put(skb, 0, 0, t, (len - sizeof(*nlh)), 0); nlh->nlmsg_flags = flags; memcpy(NLMSG_DATA(nlh), payload, size); - return iscsi_unicast_skb(skb, pid); + return iscsi_multicast_skb(skb, group, GFP_ATOMIC); } static int @@ -1078,7 +1037,7 @@ iscsi_if_get_stats(struct iscsi_transpor return -ENOMEM; } - nlhstat = __nlmsg_put(skbstat, priv->daemon_pid, 0, 0, + nlhstat = __nlmsg_put(skbstat, 0, 0, 0, (len - sizeof(*nlhstat)), 0); evstat = NLMSG_DATA(nlhstat); memset(evstat, 0, sizeof(*evstat)); @@ -1102,7 +1061,8 @@ iscsi_if_get_stats(struct iscsi_transpor skb_trim(skbstat, NLMSG_ALIGN(actual_size)); nlhstat->nlmsg_len = actual_size; - err = iscsi_unicast_skb(skbstat, priv->daemon_pid); + err = iscsi_multicast_skb(skbstat, ISCSI_NL_GRP_ISCSID, + GFP_ATOMIC); } while (err < 0 && err != -ECONNREFUSED); return err; @@ -1114,7 +1074,7 @@ iscsi_if_get_stats(struct iscsi_transpor * @event: type of event */ int iscsi_session_event(struct iscsi_cls_session *session, - enum iscsi_uevent_e event) + enum iscsi_uevent_e event) { struct iscsi_internal *priv; struct Scsi_Host *shost; @@ -1136,7 +1096,7 @@ int iscsi_session_event(struct iscsi_cls return -ENOMEM; } - nlh = __nlmsg_put(skb, priv->daemon_pid, 0, 0, (len - sizeof(*nlh)), 0); + nlh = __nlmsg_put(skb, 0, 0, 0, (len - sizeof(*nlh)), 0); ev = NLMSG_DATA(nlh); ev->transport_handle = iscsi_handle(session->transport); @@ -1165,8 +1125,8 @@ int iscsi_session_event(struct iscsi_cls * this will occur if the daemon is not up, so we just warn * the user and when the daemon is restarted it will handle it */ - rc = iscsi_broadcast_skb(skb, GFP_KERNEL); - if (rc == -ESRCH) + rc = iscsi_multicast_skb(skb, ISCSI_NL_GRP_ISCSID, GFP_KERNEL); + if (rc < 0) iscsi_cls_session_printk(KERN_ERR, session, "Cannot notify userspace of session " "event %u. Check iscsi daemon\n", @@ -1302,8 +1262,6 @@ static int iscsi_if_transport_ep(struct iscsi_transport *transport, struct iscsi_uevent *ev, int msg_type) { - return -ENOSYS; -#if 0 struct iscsi_endpoint *ep; int rc = 0; @@ -1335,8 +1293,6 @@ iscsi_if_transport_ep(struct iscsi_trans break; } return rc; - -#endif } static int @@ -1390,7 +1346,7 @@ iscsi_set_host_param(struct iscsi_transp } static int -iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) +iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, u32 *group) { int err = 0; struct iscsi_uevent *ev = NLMSG_DATA(nlh); @@ -1400,6 +1356,8 @@ iscsi_if_recv_msg(struct sk_buff *skb, s struct iscsi_cls_conn *conn; struct iscsi_endpoint *ep = NULL; + *group = ISCSI_NL_GRP_ISCSID; + priv = iscsi_if_transport_lookup(iscsi_ptr(ev->transport_handle)); if (!priv) return -EINVAL; @@ -1408,8 +1366,6 @@ iscsi_if_recv_msg(struct sk_buff *skb, s if (!try_module_get(transport->owner)) return -EINVAL; - priv->daemon_pid = NETLINK_CREDS(skb)->pid; - switch (nlh->nlmsg_type) { case ISCSI_UEVENT_CREATE_SESSION: err = iscsi_if_create_session(priv, ep, ev, @@ -1418,9 +1374,6 @@ iscsi_if_recv_msg(struct sk_buff *skb, s ev->u.c_session.queue_depth); break; case ISCSI_UEVENT_CREATE_BOUND_SESSION: - err = -ENOSYS; - break; -#if 0 ep = iscsi_lookup_endpoint(ev->u.c_bound_session.ep_handle); if (!ep) { err = -EINVAL; @@ -1432,7 +1385,6 @@ iscsi_if_recv_msg(struct sk_buff *skb, s ev->u.c_bound_session.cmds_max, ev->u.c_bound_session.queue_depth); break; -#endif case ISCSI_UEVENT_DESTROY_SESSION: session = iscsi_session_lookup(ev->u.d_session.sid); if (session) @@ -1538,6 +1490,7 @@ iscsi_if_rx(struct sock *sk, int len) uint32_t rlen; struct nlmsghdr *nlh; struct iscsi_uevent *ev; + uint32_t group; nlh = nlmsg_hdr(skb); if (nlh->nlmsg_len < sizeof(*nlh) || @@ -1550,7 +1503,7 @@ iscsi_if_rx(struct sock *sk, int len) if (rlen > skb->len) rlen = skb->len; - err = iscsi_if_recv_msg(skb, nlh); + err = iscsi_if_recv_msg(skb, nlh, &group); if (err) { ev->type = ISCSI_KEVENT_IF_ERROR; ev->iferror = err; @@ -1564,8 +1517,7 @@ iscsi_if_rx(struct sock *sk, int len) */ if (ev->type == ISCSI_UEVENT_GET_STATS && !err) break; - err = iscsi_if_send_reply( - NETLINK_CREDS(skb)->pid, nlh->nlmsg_seq, + err = iscsi_if_send_reply(group, nlh->nlmsg_seq, nlh->nlmsg_type, 0, 0, ev, sizeof(*ev)); } while (err < 0 && err != -ECONNREFUSED); skb_pull(skb, rlen); @@ -1815,7 +1767,6 @@ iscsi_register_transport(struct iscsi_tr if (!priv) return NULL; INIT_LIST_HEAD(&priv->list); - priv->daemon_pid = -1; priv->iscsi_transport = tt; priv->t.user_scan = iscsi_user_scan; priv->t.create_work_queue = 1; @@ -1956,14 +1907,13 @@ static __init int iscsi_transport_init(v if (err) return err; -#if 0 err = class_register(&iscsi_endpoint_class); if (err) goto unregister_transport_class; -#endif + err = transport_class_register(&iscsi_host_class); if (err) - goto unregister_transport_class; + goto unregister_endpoint_class; err = transport_class_register(&iscsi_connection_class); if (err) @@ -1994,10 +1944,8 @@ unregister_conn_class: transport_class_unregister(&iscsi_connection_class); unregister_host_class: transport_class_unregister(&iscsi_host_class); -#if 0 unregister_endpoint_class: class_unregister(&iscsi_endpoint_class); -#endif unregister_transport_class: class_unregister(&iscsi_transport_class); return err; @@ -2010,9 +1958,7 @@ static void __exit iscsi_transport_exit( transport_class_unregister(&iscsi_connection_class); transport_class_unregister(&iscsi_session_class); transport_class_unregister(&iscsi_host_class); -#if 0 class_unregister(&iscsi_endpoint_class); -#endif class_unregister(&iscsi_transport_class); } diff -Nuarp a/scsi_transport_iscsi.h b/scsi_transport_iscsi.h --- a/scsi_transport_iscsi.h 2009-08-31 18:32:05.000000000 +0530 +++ b/scsi_transport_iscsi.h 2009-08-31 18:33:16.000000000 +0530 @@ -25,6 +25,7 @@ #include <linux/device.h> #include <linux/list.h> +#include <linux/version.h> #include <linux/mutex.h> #include "iscsi_if.h" @@ -187,7 +188,7 @@ struct iscsi_cls_session { /* recovery fields */ int recovery_tmo; - struct delayed_work recovery_work; + struct work_struct recovery_work; unsigned int target_id; @@ -216,7 +217,7 @@ extern void iscsi_host_for_each_session( struct iscsi_endpoint { void *dd_data; /* LLD private data */ - struct device dev; + struct class_device dev; uint64_t id; }; @@ -248,9 +249,9 @@ extern struct iscsi_cls_conn *iscsi_crea extern int iscsi_destroy_conn(struct iscsi_cls_conn *conn); extern void iscsi_unblock_session(struct iscsi_cls_session *session); extern void iscsi_block_session(struct iscsi_cls_session *session); -extern int iscsi_scan_finished(struct Scsi_Host *shost, unsigned long time); extern struct iscsi_endpoint *iscsi_create_endpoint(int dd_size); extern void iscsi_destroy_endpoint(struct iscsi_endpoint *ep); extern struct iscsi_endpoint *iscsi_lookup_endpoint(u64 handle); #endif +