summaryrefslogtreecommitdiff
path: root/include/scsi
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2007-12-13 12:43:20 -0600
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-11 18:28:19 -0600
commit843c0a8a76078cf961b244b839683d0667313740 (patch)
tree3feaf71c8e67f38e10e78e315bbc8623dcf38a3d /include/scsi
parent8ae732a91df051aba6820068a47b631a06599d84 (diff)
[SCSI] libiscsi, iscsi_tcp: add device support
This patch adds logical unit reset support. This should work for ib_iser, but I have not finished testing that driver so it is not hooked in yet. This patch also temporarily reverts the iscsi_tcp r2t write out patch. That code is completely rewritten in this patchset. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/iscsi_if.h2
-rw-r--r--include/scsi/iscsi_proto.h2
-rw-r--r--include/scsi/libiscsi.h25
3 files changed, 19 insertions, 10 deletions
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index 50e907f42048..bff0b1f7857b 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -236,6 +236,7 @@ enum iscsi_param {
ISCSI_PARAM_PASSWORD,
ISCSI_PARAM_PASSWORD_IN,
+ ISCSI_PARAM_FAST_ABORT,
/* must always be last */
ISCSI_PARAM_MAX,
};
@@ -266,6 +267,7 @@ enum iscsi_param {
#define ISCSI_USERNAME_IN (1 << ISCSI_PARAM_USERNAME_IN)
#define ISCSI_PASSWORD (1 << ISCSI_PARAM_PASSWORD)
#define ISCSI_PASSWORD_IN (1 << ISCSI_PARAM_PASSWORD_IN)
+#define ISCSI_FAST_ABORT (1 << ISCSI_PARAM_FAST_ABORT)
/* iSCSI HBA params */
enum iscsi_host_param {
diff --git a/include/scsi/iscsi_proto.h b/include/scsi/iscsi_proto.h
index 8d1e4e8026fe..751c81eaa7f3 100644
--- a/include/scsi/iscsi_proto.h
+++ b/include/scsi/iscsi_proto.h
@@ -600,6 +600,8 @@ struct iscsi_reject {
#define ISCSI_MIN_MAX_BURST_LEN 512
#define ISCSI_MAX_MAX_BURST_LEN 16777215
+#define ISCSI_DEF_TIME2WAIT 2
+
/************************* RFC 3720 End *****************************/
#endif /* ISCSI_PROTO_H */
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index b4b31132618b..89429f433f85 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -57,11 +57,14 @@ struct iscsi_nopin;
#define ISCSI_MAX_CMD_PER_LUN 128
/* Task Mgmt states */
-#define TMABORT_INITIAL 0x0
-#define TMABORT_SUCCESS 0x1
-#define TMABORT_FAILED 0x2
-#define TMABORT_TIMEDOUT 0x3
-#define TMABORT_NOT_FOUND 0x4
+enum {
+ TMF_INITIAL,
+ TMF_QUEUED,
+ TMF_SUCCESS,
+ TMF_FAILED,
+ TMF_TIMEDOUT,
+ TMF_NOT_FOUND,
+};
/* Connection suspend "bit" */
#define ISCSI_SUSPEND_BIT 1
@@ -91,7 +94,6 @@ enum {
ISCSI_TASK_COMPLETED,
ISCSI_TASK_PENDING,
ISCSI_TASK_RUNNING,
- ISCSI_TASK_ABORTING,
};
struct iscsi_cmd_task {
@@ -110,7 +112,6 @@ struct iscsi_cmd_task {
unsigned data_count; /* remaining Data-Out */
struct scsi_cmnd *sc; /* associated SCSI cmd*/
struct iscsi_conn *conn; /* used connection */
- struct iscsi_mgmt_task *mtask; /* tmf mtask in progr */
/* state set/tested under session->lock */
int state;
@@ -152,10 +153,11 @@ struct iscsi_conn {
struct iscsi_cmd_task *ctask; /* xmit ctask in progress */
/* xmit */
- struct kfifo *mgmtqueue; /* mgmt (control) xmit queue */
+ struct list_head mgmtqueue; /* mgmt (control) xmit queue */
struct list_head mgmt_run_list; /* list of control tasks */
struct list_head xmitqueue; /* data-path cmd queue */
struct list_head run_list; /* list of cmds in progress */
+ struct list_head requeue; /* tasks needing another run */
struct work_struct xmitwork; /* per-conn. xmit workqueue */
unsigned long suspend_tx; /* suspend Tx */
unsigned long suspend_rx; /* suspend Rx */
@@ -163,8 +165,8 @@ struct iscsi_conn {
/* abort */
wait_queue_head_t ehwait; /* used in eh_abort() */
struct iscsi_tm tmhdr;
- struct timer_list tmabort_timer;
- int tmabort_state; /* see TMABORT_INITIAL, etc.*/
+ struct timer_list tmf_timer;
+ int tmf_state; /* see TMF_INITIAL, etc.*/
/* negotiated params */
unsigned max_recv_dlength; /* initiator_max_recv_dsl*/
@@ -231,6 +233,7 @@ struct iscsi_session {
int pdu_inorder_en;
int dataseq_inorder_en;
int erl;
+ int fast_abort;
int tpgt;
char *username;
char *username_in;
@@ -268,6 +271,7 @@ struct iscsi_session {
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_host_reset(struct scsi_cmnd *sc);
+extern int iscsi_eh_device_reset(struct scsi_cmnd *sc);
extern int iscsi_queuecommand(struct scsi_cmnd *sc,
void (*done)(struct scsi_cmnd *));
@@ -326,6 +330,7 @@ extern int __iscsi_complete_pdu(struct iscsi_conn *, struct iscsi_hdr *,
char *, int);
extern int iscsi_verify_itt(struct iscsi_conn *, struct iscsi_hdr *,
uint32_t *);
+extern void iscsi_requeue_ctask(struct iscsi_cmd_task *ctask);
/*
* generic helpers