diff options
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/iscsi_if.h | 2 | ||||
-rw-r--r-- | include/scsi/libiscsi.h | 15 | ||||
-rw-r--r-- | include/scsi/scsi.h | 6 | ||||
-rw-r--r-- | include/scsi/scsi_device.h | 10 | ||||
-rw-r--r-- | include/scsi/scsi_ioctl.h | 2 | ||||
-rw-r--r-- | include/scsi/scsi_transport_fc.h | 8 | ||||
-rw-r--r-- | include/scsi/scsi_transport_iscsi.h | 5 |
7 files changed, 42 insertions, 6 deletions
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index 16be12f1cbe..0c9514de5df 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
@@ -213,6 +213,8 @@ enum iscsi_err { | |||
213 | ISCSI_ERR_DATA_DGST = ISCSI_ERR_BASE + 15, | 213 | ISCSI_ERR_DATA_DGST = ISCSI_ERR_BASE + 15, |
214 | ISCSI_ERR_PARAM_NOT_FOUND = ISCSI_ERR_BASE + 16, | 214 | ISCSI_ERR_PARAM_NOT_FOUND = ISCSI_ERR_BASE + 16, |
215 | ISCSI_ERR_NO_SCSI_CMD = ISCSI_ERR_BASE + 17, | 215 | ISCSI_ERR_NO_SCSI_CMD = ISCSI_ERR_BASE + 17, |
216 | ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18, | ||
217 | ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19, | ||
216 | }; | 218 | }; |
217 | 219 | ||
218 | /* | 220 | /* |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index 5e75bb7f311..61e53f14f7e 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
@@ -287,6 +287,11 @@ struct iscsi_session { | |||
287 | struct iscsi_pool cmdpool; /* PDU's pool */ | 287 | struct iscsi_pool cmdpool; /* PDU's pool */ |
288 | }; | 288 | }; |
289 | 289 | ||
290 | enum { | ||
291 | ISCSI_HOST_SETUP, | ||
292 | ISCSI_HOST_REMOVED, | ||
293 | }; | ||
294 | |||
290 | struct iscsi_host { | 295 | struct iscsi_host { |
291 | char *initiatorname; | 296 | char *initiatorname; |
292 | /* hw address or netdev iscsi connection is bound to */ | 297 | /* hw address or netdev iscsi connection is bound to */ |
@@ -295,6 +300,12 @@ struct iscsi_host { | |||
295 | /* local address */ | 300 | /* local address */ |
296 | int local_port; | 301 | int local_port; |
297 | char local_address[ISCSI_ADDRESS_BUF_LEN]; | 302 | char local_address[ISCSI_ADDRESS_BUF_LEN]; |
303 | |||
304 | wait_queue_head_t session_removal_wq; | ||
305 | /* protects sessions and state */ | ||
306 | spinlock_t lock; | ||
307 | int num_sessions; | ||
308 | int state; | ||
298 | }; | 309 | }; |
299 | 310 | ||
300 | /* | 311 | /* |
@@ -302,7 +313,7 @@ struct iscsi_host { | |||
302 | */ | 313 | */ |
303 | extern int iscsi_change_queue_depth(struct scsi_device *sdev, int depth); | 314 | extern int iscsi_change_queue_depth(struct scsi_device *sdev, int depth); |
304 | extern int iscsi_eh_abort(struct scsi_cmnd *sc); | 315 | extern int iscsi_eh_abort(struct scsi_cmnd *sc); |
305 | extern int iscsi_eh_host_reset(struct scsi_cmnd *sc); | 316 | extern int iscsi_eh_target_reset(struct scsi_cmnd *sc); |
306 | extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); | 317 | extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); |
307 | extern int iscsi_queuecommand(struct scsi_cmnd *sc, | 318 | extern int iscsi_queuecommand(struct scsi_cmnd *sc, |
308 | void (*done)(struct scsi_cmnd *)); | 319 | void (*done)(struct scsi_cmnd *)); |
@@ -351,6 +362,8 @@ extern void iscsi_conn_stop(struct iscsi_cls_conn *, int); | |||
351 | extern int iscsi_conn_bind(struct iscsi_cls_session *, struct iscsi_cls_conn *, | 362 | extern int iscsi_conn_bind(struct iscsi_cls_session *, struct iscsi_cls_conn *, |
352 | int); | 363 | int); |
353 | extern void iscsi_conn_failure(struct iscsi_conn *conn, enum iscsi_err err); | 364 | extern void iscsi_conn_failure(struct iscsi_conn *conn, enum iscsi_err err); |
365 | extern void iscsi_session_failure(struct iscsi_cls_session *cls_session, | ||
366 | enum iscsi_err err); | ||
354 | extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, | 367 | extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, |
355 | enum iscsi_param param, char *buf); | 368 | enum iscsi_param param, char *buf); |
356 | extern void iscsi_suspend_tx(struct iscsi_conn *conn); | 369 | extern void iscsi_suspend_tx(struct iscsi_conn *conn); |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 192f8716aa9..a109165714d 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -381,6 +381,11 @@ static inline int scsi_is_wlun(unsigned int lun) | |||
381 | #define DID_IMM_RETRY 0x0c /* Retry without decrementing retry count */ | 381 | #define DID_IMM_RETRY 0x0c /* Retry without decrementing retry count */ |
382 | #define DID_REQUEUE 0x0d /* Requeue command (no immediate retry) also | 382 | #define DID_REQUEUE 0x0d /* Requeue command (no immediate retry) also |
383 | * without decrementing the retry count */ | 383 | * without decrementing the retry count */ |
384 | #define DID_TRANSPORT_DISRUPTED 0x0e /* Transport error disrupted execution | ||
385 | * and the driver blocked the port to | ||
386 | * recover the link. Transport class will | ||
387 | * retry or fail IO */ | ||
388 | #define DID_TRANSPORT_FAILFAST 0x0f /* Transport class fastfailed the io */ | ||
384 | #define DRIVER_OK 0x00 /* Driver status */ | 389 | #define DRIVER_OK 0x00 /* Driver status */ |
385 | 390 | ||
386 | /* | 391 | /* |
@@ -426,6 +431,7 @@ static inline int scsi_is_wlun(unsigned int lun) | |||
426 | #define SCSI_MLQUEUE_HOST_BUSY 0x1055 | 431 | #define SCSI_MLQUEUE_HOST_BUSY 0x1055 |
427 | #define SCSI_MLQUEUE_DEVICE_BUSY 0x1056 | 432 | #define SCSI_MLQUEUE_DEVICE_BUSY 0x1056 |
428 | #define SCSI_MLQUEUE_EH_RETRY 0x1057 | 433 | #define SCSI_MLQUEUE_EH_RETRY 0x1057 |
434 | #define SCSI_MLQUEUE_TARGET_BUSY 0x1058 | ||
429 | 435 | ||
430 | /* | 436 | /* |
431 | * Use these to separate status msg and our bytes | 437 | * Use these to separate status msg and our bytes |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index b49e725be03..a37a8148a31 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -238,6 +238,16 @@ struct scsi_target { | |||
238 | * for the device at a time. */ | 238 | * for the device at a time. */ |
239 | unsigned int pdt_1f_for_no_lun; /* PDT = 0x1f */ | 239 | unsigned int pdt_1f_for_no_lun; /* PDT = 0x1f */ |
240 | /* means no lun present */ | 240 | /* means no lun present */ |
241 | /* commands actually active on LLD. protected by host lock. */ | ||
242 | unsigned int target_busy; | ||
243 | /* | ||
244 | * LLDs should set this in the slave_alloc host template callout. | ||
245 | * If set to zero then there is not limit. | ||
246 | */ | ||
247 | unsigned int can_queue; | ||
248 | unsigned int target_blocked; | ||
249 | unsigned int max_target_blocked; | ||
250 | #define SCSI_DEFAULT_TARGET_BLOCKED 3 | ||
241 | 251 | ||
242 | char scsi_level; | 252 | char scsi_level; |
243 | struct execute_work ew; | 253 | struct execute_work ew; |
diff --git a/include/scsi/scsi_ioctl.h b/include/scsi/scsi_ioctl.h index edb9525386d..b9006848b81 100644 --- a/include/scsi/scsi_ioctl.h +++ b/include/scsi/scsi_ioctl.h | |||
@@ -42,7 +42,7 @@ typedef struct scsi_fctargaddress { | |||
42 | 42 | ||
43 | extern int scsi_ioctl(struct scsi_device *, int, void __user *); | 43 | extern int scsi_ioctl(struct scsi_device *, int, void __user *); |
44 | extern int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd, | 44 | extern int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd, |
45 | void __user *arg, struct file *filp); | 45 | void __user *arg, int ndelay); |
46 | 46 | ||
47 | #endif /* __KERNEL__ */ | 47 | #endif /* __KERNEL__ */ |
48 | #endif /* _SCSI_IOCTL_H */ | 48 | #endif /* _SCSI_IOCTL_H */ |
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index 21018a4df45..49d8913c4f8 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h | |||
@@ -357,6 +357,7 @@ struct fc_rport { /* aka fc_starget_attrs */ | |||
357 | /* bit field values for struct fc_rport "flags" field: */ | 357 | /* bit field values for struct fc_rport "flags" field: */ |
358 | #define FC_RPORT_DEVLOSS_PENDING 0x01 | 358 | #define FC_RPORT_DEVLOSS_PENDING 0x01 |
359 | #define FC_RPORT_SCAN_PENDING 0x02 | 359 | #define FC_RPORT_SCAN_PENDING 0x02 |
360 | #define FC_RPORT_FAST_FAIL_TIMEDOUT 0x03 | ||
360 | 361 | ||
361 | #define dev_to_rport(d) \ | 362 | #define dev_to_rport(d) \ |
362 | container_of(d, struct fc_rport, dev) | 363 | container_of(d, struct fc_rport, dev) |
@@ -678,12 +679,15 @@ fc_remote_port_chkready(struct fc_rport *rport) | |||
678 | if (rport->roles & FC_PORT_ROLE_FCP_TARGET) | 679 | if (rport->roles & FC_PORT_ROLE_FCP_TARGET) |
679 | result = 0; | 680 | result = 0; |
680 | else if (rport->flags & FC_RPORT_DEVLOSS_PENDING) | 681 | else if (rport->flags & FC_RPORT_DEVLOSS_PENDING) |
681 | result = DID_IMM_RETRY << 16; | 682 | result = DID_TRANSPORT_DISRUPTED << 16; |
682 | else | 683 | else |
683 | result = DID_NO_CONNECT << 16; | 684 | result = DID_NO_CONNECT << 16; |
684 | break; | 685 | break; |
685 | case FC_PORTSTATE_BLOCKED: | 686 | case FC_PORTSTATE_BLOCKED: |
686 | result = DID_IMM_RETRY << 16; | 687 | if (rport->flags & FC_RPORT_FAST_FAIL_TIMEDOUT) |
688 | result = DID_TRANSPORT_FAILFAST << 16; | ||
689 | else | ||
690 | result = DID_TRANSPORT_DISRUPTED << 16; | ||
687 | break; | 691 | break; |
688 | default: | 692 | default: |
689 | result = DID_NO_CONNECT << 16; | 693 | result = DID_NO_CONNECT << 16; |
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 8b6c91df4c7..c667cc39654 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h | |||
@@ -135,7 +135,8 @@ extern int iscsi_unregister_transport(struct iscsi_transport *tt); | |||
135 | /* | 135 | /* |
136 | * control plane upcalls | 136 | * control plane upcalls |
137 | */ | 137 | */ |
138 | extern void iscsi_conn_error(struct iscsi_cls_conn *conn, enum iscsi_err error); | 138 | extern void iscsi_conn_error_event(struct iscsi_cls_conn *conn, |
139 | enum iscsi_err error); | ||
139 | extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, | 140 | extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, |
140 | char *data, uint32_t data_size); | 141 | char *data, uint32_t data_size); |
141 | 142 | ||
@@ -207,7 +208,7 @@ extern void iscsi_host_for_each_session(struct Scsi_Host *shost, | |||
207 | struct iscsi_endpoint { | 208 | struct iscsi_endpoint { |
208 | void *dd_data; /* LLD private data */ | 209 | void *dd_data; /* LLD private data */ |
209 | struct device dev; | 210 | struct device dev; |
210 | unsigned int id; | 211 | uint64_t id; |
211 | }; | 212 | }; |
212 | 213 | ||
213 | /* | 214 | /* |