diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2007-12-13 13:43:20 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-11 19:28:19 -0500 |
commit | 843c0a8a76078cf961b244b839683d0667313740 (patch) | |
tree | 3feaf71c8e67f38e10e78e315bbc8623dcf38a3d /include/scsi | |
parent | 8ae732a91df051aba6820068a47b631a06599d84 (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.h | 2 | ||||
-rw-r--r-- | include/scsi/iscsi_proto.h | 2 | ||||
-rw-r--r-- | include/scsi/libiscsi.h | 25 |
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 { | |||
236 | ISCSI_PARAM_PASSWORD, | 236 | ISCSI_PARAM_PASSWORD, |
237 | ISCSI_PARAM_PASSWORD_IN, | 237 | ISCSI_PARAM_PASSWORD_IN, |
238 | 238 | ||
239 | ISCSI_PARAM_FAST_ABORT, | ||
239 | /* must always be last */ | 240 | /* must always be last */ |
240 | ISCSI_PARAM_MAX, | 241 | ISCSI_PARAM_MAX, |
241 | }; | 242 | }; |
@@ -266,6 +267,7 @@ enum iscsi_param { | |||
266 | #define ISCSI_USERNAME_IN (1 << ISCSI_PARAM_USERNAME_IN) | 267 | #define ISCSI_USERNAME_IN (1 << ISCSI_PARAM_USERNAME_IN) |
267 | #define ISCSI_PASSWORD (1 << ISCSI_PARAM_PASSWORD) | 268 | #define ISCSI_PASSWORD (1 << ISCSI_PARAM_PASSWORD) |
268 | #define ISCSI_PASSWORD_IN (1 << ISCSI_PARAM_PASSWORD_IN) | 269 | #define ISCSI_PASSWORD_IN (1 << ISCSI_PARAM_PASSWORD_IN) |
270 | #define ISCSI_FAST_ABORT (1 << ISCSI_PARAM_FAST_ABORT) | ||
269 | 271 | ||
270 | /* iSCSI HBA params */ | 272 | /* iSCSI HBA params */ |
271 | enum iscsi_host_param { | 273 | 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 { | |||
600 | #define ISCSI_MIN_MAX_BURST_LEN 512 | 600 | #define ISCSI_MIN_MAX_BURST_LEN 512 |
601 | #define ISCSI_MAX_MAX_BURST_LEN 16777215 | 601 | #define ISCSI_MAX_MAX_BURST_LEN 16777215 |
602 | 602 | ||
603 | #define ISCSI_DEF_TIME2WAIT 2 | ||
604 | |||
603 | /************************* RFC 3720 End *****************************/ | 605 | /************************* RFC 3720 End *****************************/ |
604 | 606 | ||
605 | #endif /* ISCSI_PROTO_H */ | 607 | #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; | |||
57 | #define ISCSI_MAX_CMD_PER_LUN 128 | 57 | #define ISCSI_MAX_CMD_PER_LUN 128 |
58 | 58 | ||
59 | /* Task Mgmt states */ | 59 | /* Task Mgmt states */ |
60 | #define TMABORT_INITIAL 0x0 | 60 | enum { |
61 | #define TMABORT_SUCCESS 0x1 | 61 | TMF_INITIAL, |
62 | #define TMABORT_FAILED 0x2 | 62 | TMF_QUEUED, |
63 | #define TMABORT_TIMEDOUT 0x3 | 63 | TMF_SUCCESS, |
64 | #define TMABORT_NOT_FOUND 0x4 | 64 | TMF_FAILED, |
65 | TMF_TIMEDOUT, | ||
66 | TMF_NOT_FOUND, | ||
67 | }; | ||
65 | 68 | ||
66 | /* Connection suspend "bit" */ | 69 | /* Connection suspend "bit" */ |
67 | #define ISCSI_SUSPEND_BIT 1 | 70 | #define ISCSI_SUSPEND_BIT 1 |
@@ -91,7 +94,6 @@ enum { | |||
91 | ISCSI_TASK_COMPLETED, | 94 | ISCSI_TASK_COMPLETED, |
92 | ISCSI_TASK_PENDING, | 95 | ISCSI_TASK_PENDING, |
93 | ISCSI_TASK_RUNNING, | 96 | ISCSI_TASK_RUNNING, |
94 | ISCSI_TASK_ABORTING, | ||
95 | }; | 97 | }; |
96 | 98 | ||
97 | struct iscsi_cmd_task { | 99 | struct iscsi_cmd_task { |
@@ -110,7 +112,6 @@ struct iscsi_cmd_task { | |||
110 | unsigned data_count; /* remaining Data-Out */ | 112 | unsigned data_count; /* remaining Data-Out */ |
111 | struct scsi_cmnd *sc; /* associated SCSI cmd*/ | 113 | struct scsi_cmnd *sc; /* associated SCSI cmd*/ |
112 | struct iscsi_conn *conn; /* used connection */ | 114 | struct iscsi_conn *conn; /* used connection */ |
113 | struct iscsi_mgmt_task *mtask; /* tmf mtask in progr */ | ||
114 | 115 | ||
115 | /* state set/tested under session->lock */ | 116 | /* state set/tested under session->lock */ |
116 | int state; | 117 | int state; |
@@ -152,10 +153,11 @@ struct iscsi_conn { | |||
152 | struct iscsi_cmd_task *ctask; /* xmit ctask in progress */ | 153 | struct iscsi_cmd_task *ctask; /* xmit ctask in progress */ |
153 | 154 | ||
154 | /* xmit */ | 155 | /* xmit */ |
155 | struct kfifo *mgmtqueue; /* mgmt (control) xmit queue */ | 156 | struct list_head mgmtqueue; /* mgmt (control) xmit queue */ |
156 | struct list_head mgmt_run_list; /* list of control tasks */ | 157 | struct list_head mgmt_run_list; /* list of control tasks */ |
157 | struct list_head xmitqueue; /* data-path cmd queue */ | 158 | struct list_head xmitqueue; /* data-path cmd queue */ |
158 | struct list_head run_list; /* list of cmds in progress */ | 159 | struct list_head run_list; /* list of cmds in progress */ |
160 | struct list_head requeue; /* tasks needing another run */ | ||
159 | struct work_struct xmitwork; /* per-conn. xmit workqueue */ | 161 | struct work_struct xmitwork; /* per-conn. xmit workqueue */ |
160 | unsigned long suspend_tx; /* suspend Tx */ | 162 | unsigned long suspend_tx; /* suspend Tx */ |
161 | unsigned long suspend_rx; /* suspend Rx */ | 163 | unsigned long suspend_rx; /* suspend Rx */ |
@@ -163,8 +165,8 @@ struct iscsi_conn { | |||
163 | /* abort */ | 165 | /* abort */ |
164 | wait_queue_head_t ehwait; /* used in eh_abort() */ | 166 | wait_queue_head_t ehwait; /* used in eh_abort() */ |
165 | struct iscsi_tm tmhdr; | 167 | struct iscsi_tm tmhdr; |
166 | struct timer_list tmabort_timer; | 168 | struct timer_list tmf_timer; |
167 | int tmabort_state; /* see TMABORT_INITIAL, etc.*/ | 169 | int tmf_state; /* see TMF_INITIAL, etc.*/ |
168 | 170 | ||
169 | /* negotiated params */ | 171 | /* negotiated params */ |
170 | unsigned max_recv_dlength; /* initiator_max_recv_dsl*/ | 172 | unsigned max_recv_dlength; /* initiator_max_recv_dsl*/ |
@@ -231,6 +233,7 @@ struct iscsi_session { | |||
231 | int pdu_inorder_en; | 233 | int pdu_inorder_en; |
232 | int dataseq_inorder_en; | 234 | int dataseq_inorder_en; |
233 | int erl; | 235 | int erl; |
236 | int fast_abort; | ||
234 | int tpgt; | 237 | int tpgt; |
235 | char *username; | 238 | char *username; |
236 | char *username_in; | 239 | char *username_in; |
@@ -268,6 +271,7 @@ struct iscsi_session { | |||
268 | extern int iscsi_change_queue_depth(struct scsi_device *sdev, int depth); | 271 | extern int iscsi_change_queue_depth(struct scsi_device *sdev, int depth); |
269 | extern int iscsi_eh_abort(struct scsi_cmnd *sc); | 272 | extern int iscsi_eh_abort(struct scsi_cmnd *sc); |
270 | extern int iscsi_eh_host_reset(struct scsi_cmnd *sc); | 273 | extern int iscsi_eh_host_reset(struct scsi_cmnd *sc); |
274 | extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); | ||
271 | extern int iscsi_queuecommand(struct scsi_cmnd *sc, | 275 | extern int iscsi_queuecommand(struct scsi_cmnd *sc, |
272 | void (*done)(struct scsi_cmnd *)); | 276 | void (*done)(struct scsi_cmnd *)); |
273 | 277 | ||
@@ -326,6 +330,7 @@ extern int __iscsi_complete_pdu(struct iscsi_conn *, struct iscsi_hdr *, | |||
326 | char *, int); | 330 | char *, int); |
327 | extern int iscsi_verify_itt(struct iscsi_conn *, struct iscsi_hdr *, | 331 | extern int iscsi_verify_itt(struct iscsi_conn *, struct iscsi_hdr *, |
328 | uint32_t *); | 332 | uint32_t *); |
333 | extern void iscsi_requeue_ctask(struct iscsi_cmd_task *ctask); | ||
329 | 334 | ||
330 | /* | 335 | /* |
331 | * generic helpers | 336 | * generic helpers |