aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-04-14 16:47:45 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-04-14 16:47:45 -0400
commit84d891d6727c17832c79ec96d3d107a87d857978 (patch)
treea189a4d00c1387e409e2f9808c72c8088728c33b /include
parent5bb0b55a3283369f1cd8ac76a6d8bda8e7a77055 (diff)
parent7676f83aeb774e7a3abe6af06ec92b29488b5b79 (diff)
Merge ../scsi-rc-fixes-2.6
Conflicts: include/scsi/scsi_devinfo.h Same number for two BLIST flags: BLIST_MAX_512 and BLIST_ATTACH_PQ3 Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/blkdev.h4
-rw-r--r--include/scsi/scsi_devinfo.h3
-rw-r--r--include/scsi/scsi_ioctl.h2
-rw-r--r--include/scsi/scsi_transport_fc.h41
4 files changed, 36 insertions, 14 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index d0cac8b58de7..59e1259b1c40 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -17,6 +17,8 @@
17 17
18#include <asm/scatterlist.h> 18#include <asm/scatterlist.h>
19 19
20struct scsi_ioctl_command;
21
20struct request_queue; 22struct request_queue;
21typedef struct request_queue request_queue_t; 23typedef struct request_queue request_queue_t;
22struct elevator_queue; 24struct elevator_queue;
@@ -611,6 +613,8 @@ extern void blk_plug_device(request_queue_t *);
611extern int blk_remove_plug(request_queue_t *); 613extern int blk_remove_plug(request_queue_t *);
612extern void blk_recount_segments(request_queue_t *, struct bio *); 614extern void blk_recount_segments(request_queue_t *, struct bio *);
613extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *); 615extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *);
616extern int sg_scsi_ioctl(struct file *, struct request_queue *,
617 struct gendisk *, struct scsi_ioctl_command __user *);
614extern void blk_start_queue(request_queue_t *q); 618extern void blk_start_queue(request_queue_t *q);
615extern void blk_stop_queue(request_queue_t *q); 619extern void blk_stop_queue(request_queue_t *q);
616extern void blk_sync_queue(struct request_queue *q); 620extern void blk_sync_queue(struct request_queue *q);
diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h
index 599966898208..b4ddd3b18b4c 100644
--- a/include/scsi/scsi_devinfo.h
+++ b/include/scsi/scsi_devinfo.h
@@ -28,5 +28,6 @@
28#define BLIST_NO_ULD_ATTACH 0x100000 /* device is actually for RAID config */ 28#define BLIST_NO_ULD_ATTACH 0x100000 /* device is actually for RAID config */
29#define BLIST_SELECT_NO_ATN 0x200000 /* select without ATN */ 29#define BLIST_SELECT_NO_ATN 0x200000 /* select without ATN */
30#define BLIST_RETRY_HWERROR 0x400000 /* retry HARDWARE_ERROR */ 30#define BLIST_RETRY_HWERROR 0x400000 /* retry HARDWARE_ERROR */
31#define BLIST_ATTACH_PQ3 0x800000 /* Scan: Attach to PQ3 devices */ 31#define BLIST_MAX_512 0x800000 /* maximum 512 sector cdb length */
32#define BLIST_ATTACH_PQ3 0x1000000 /* Scan: Attach to PQ3 devices */
32#endif 33#endif
diff --git a/include/scsi/scsi_ioctl.h b/include/scsi/scsi_ioctl.h
index d4be4d92d586..edb9525386da 100644
--- a/include/scsi/scsi_ioctl.h
+++ b/include/scsi/scsi_ioctl.h
@@ -41,8 +41,6 @@ typedef struct scsi_fctargaddress {
41} Scsi_FCTargAddress; 41} Scsi_FCTargAddress;
42 42
43extern int scsi_ioctl(struct scsi_device *, int, void __user *); 43extern int scsi_ioctl(struct scsi_device *, int, void __user *);
44extern int scsi_ioctl_send_command(struct scsi_device *,
45 struct scsi_ioctl_command __user *);
46extern int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd, 44extern int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd,
47 void __user *arg, struct file *filp); 45 void __user *arg, struct file *filp);
48 46
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index cf3fec8be1e3..5626225bd3ae 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -202,12 +202,19 @@ struct fc_rport { /* aka fc_starget_attrs */
202 /* internal data */ 202 /* internal data */
203 unsigned int channel; 203 unsigned int channel;
204 u32 number; 204 u32 number;
205 u8 flags;
205 struct list_head peers; 206 struct list_head peers;
206 struct device dev; 207 struct device dev;
207 struct work_struct dev_loss_work; 208 struct work_struct dev_loss_work;
208 struct work_struct scan_work; 209 struct work_struct scan_work;
210 struct work_struct stgt_delete_work;
211 struct work_struct rport_delete_work;
209} __attribute__((aligned(sizeof(unsigned long)))); 212} __attribute__((aligned(sizeof(unsigned long))));
210 213
214/* bit field values for struct fc_rport "flags" field: */
215#define FC_RPORT_DEVLOSS_PENDING 0x01
216#define FC_RPORT_SCAN_PENDING 0x02
217
211#define dev_to_rport(d) \ 218#define dev_to_rport(d) \
212 container_of(d, struct fc_rport, dev) 219 container_of(d, struct fc_rport, dev)
213#define transport_class_to_rport(classdev) \ 220#define transport_class_to_rport(classdev) \
@@ -327,13 +334,16 @@ struct fc_host_attrs {
327 struct list_head rport_bindings; 334 struct list_head rport_bindings;
328 u32 next_rport_number; 335 u32 next_rport_number;
329 u32 next_target_id; 336 u32 next_target_id;
330 u8 flags;
331 struct work_struct rport_del_work;
332};
333 337
334/* values for struct fc_host_attrs "flags" field: */ 338 /* work queues for rport state manipulation */
335#define FC_SHOST_RPORT_DEL_SCHEDULED 0x01 339 char work_q_name[KOBJ_NAME_LEN];
340 struct workqueue_struct *work_q;
341 char devloss_work_q_name[KOBJ_NAME_LEN];
342 struct workqueue_struct *devloss_work_q;
343};
336 344
345#define shost_to_fc_host(x) \
346 ((struct fc_host_attrs *)(x)->shost_data)
337 347
338#define fc_host_node_name(x) \ 348#define fc_host_node_name(x) \
339 (((struct fc_host_attrs *)(x)->shost_data)->node_name) 349 (((struct fc_host_attrs *)(x)->shost_data)->node_name)
@@ -375,10 +385,14 @@ struct fc_host_attrs {
375 (((struct fc_host_attrs *)(x)->shost_data)->next_rport_number) 385 (((struct fc_host_attrs *)(x)->shost_data)->next_rport_number)
376#define fc_host_next_target_id(x) \ 386#define fc_host_next_target_id(x) \
377 (((struct fc_host_attrs *)(x)->shost_data)->next_target_id) 387 (((struct fc_host_attrs *)(x)->shost_data)->next_target_id)
378#define fc_host_flags(x) \ 388#define fc_host_work_q_name(x) \
379 (((struct fc_host_attrs *)(x)->shost_data)->flags) 389 (((struct fc_host_attrs *)(x)->shost_data)->work_q_name)
380#define fc_host_rport_del_work(x) \ 390#define fc_host_work_q(x) \
381 (((struct fc_host_attrs *)(x)->shost_data)->rport_del_work) 391 (((struct fc_host_attrs *)(x)->shost_data)->work_q)
392#define fc_host_devloss_work_q_name(x) \
393 (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q_name)
394#define fc_host_devloss_work_q(x) \
395 (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q)
382 396
383 397
384/* The functions by which the transport class and the driver communicate */ 398/* The functions by which the transport class and the driver communicate */
@@ -461,10 +475,15 @@ fc_remote_port_chkready(struct fc_rport *rport)
461 475
462 switch (rport->port_state) { 476 switch (rport->port_state) {
463 case FC_PORTSTATE_ONLINE: 477 case FC_PORTSTATE_ONLINE:
464 result = 0; 478 if (rport->roles & FC_RPORT_ROLE_FCP_TARGET)
479 result = 0;
480 else if (rport->flags & FC_RPORT_DEVLOSS_PENDING)
481 result = DID_IMM_RETRY << 16;
482 else
483 result = DID_NO_CONNECT << 16;
465 break; 484 break;
466 case FC_PORTSTATE_BLOCKED: 485 case FC_PORTSTATE_BLOCKED:
467 result = DID_BUS_BUSY << 16; 486 result = DID_IMM_RETRY << 16;
468 break; 487 break;
469 default: 488 default:
470 result = DID_NO_CONNECT << 16; 489 result = DID_NO_CONNECT << 16;