aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/scsi_host.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi/scsi_host.h')
-rw-r--r--include/scsi/scsi_host.h32
1 files changed, 29 insertions, 3 deletions
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index b7bdecb7b76e..f1f2644137b8 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -46,7 +46,7 @@ struct blk_queue_tags;
46enum { 46enum {
47 SCSI_QDEPTH_DEFAULT, /* default requested change, e.g. from sysfs */ 47 SCSI_QDEPTH_DEFAULT, /* default requested change, e.g. from sysfs */
48 SCSI_QDEPTH_QFULL, /* scsi-ml requested due to queue full */ 48 SCSI_QDEPTH_QFULL, /* scsi-ml requested due to queue full */
49 SCSI_QDEPTH_RAMP_UP, /* scsi-ml requested due to threshhold event */ 49 SCSI_QDEPTH_RAMP_UP, /* scsi-ml requested due to threshold event */
50}; 50};
51 51
52struct scsi_host_template { 52struct scsi_host_template {
@@ -127,8 +127,7 @@ struct scsi_host_template {
127 * 127 *
128 * STATUS: REQUIRED 128 * STATUS: REQUIRED
129 */ 129 */
130 int (* queuecommand)(struct scsi_cmnd *, 130 int (* queuecommand)(struct Scsi_Host *, struct scsi_cmnd *);
131 void (*done)(struct scsi_cmnd *));
132 131
133 /* 132 /*
134 * The transfer functions are used to queue a scsi command to 133 * The transfer functions are used to queue a scsi command to
@@ -388,6 +387,7 @@ struct scsi_host_template {
388 * of scatter-gather. 387 * of scatter-gather.
389 */ 388 */
390 unsigned short sg_tablesize; 389 unsigned short sg_tablesize;
390 unsigned short sg_prot_tablesize;
391 391
392 /* 392 /*
393 * Set this if the host adapter has limitations beside segment count. 393 * Set this if the host adapter has limitations beside segment count.
@@ -504,6 +504,25 @@ struct scsi_host_template {
504}; 504};
505 505
506/* 506/*
507 * Temporary #define for host lock push down. Can be removed when all
508 * drivers have been updated to take advantage of unlocked
509 * queuecommand.
510 *
511 */
512#define DEF_SCSI_QCMD(func_name) \
513 int func_name(struct Scsi_Host *shost, struct scsi_cmnd *cmd) \
514 { \
515 unsigned long irq_flags; \
516 int rc; \
517 spin_lock_irqsave(shost->host_lock, irq_flags); \
518 scsi_cmd_get_serial(shost, cmd); \
519 rc = func_name##_lck (cmd, cmd->scsi_done); \
520 spin_unlock_irqrestore(shost->host_lock, irq_flags); \
521 return rc; \
522 }
523
524
525/*
507 * shost state: If you alter this, you also need to alter scsi_sysfs.c 526 * shost state: If you alter this, you also need to alter scsi_sysfs.c
508 * (for the ascii descriptions) and the state model enforcer: 527 * (for the ascii descriptions) and the state model enforcer:
509 * scsi_host_set_state() 528 * scsi_host_set_state()
@@ -599,6 +618,7 @@ struct Scsi_Host {
599 int can_queue; 618 int can_queue;
600 short cmd_per_lun; 619 short cmd_per_lun;
601 short unsigned int sg_tablesize; 620 short unsigned int sg_tablesize;
621 short unsigned int sg_prot_tablesize;
602 short unsigned int max_sectors; 622 short unsigned int max_sectors;
603 unsigned long dma_boundary; 623 unsigned long dma_boundary;
604 /* 624 /*
@@ -750,6 +770,7 @@ extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *);
750extern void scsi_host_put(struct Scsi_Host *t); 770extern void scsi_host_put(struct Scsi_Host *t);
751extern struct Scsi_Host *scsi_host_lookup(unsigned short); 771extern struct Scsi_Host *scsi_host_lookup(unsigned short);
752extern const char *scsi_host_state_name(enum scsi_host_state); 772extern const char *scsi_host_state_name(enum scsi_host_state);
773extern void scsi_cmd_get_serial(struct Scsi_Host *, struct scsi_cmnd *);
753 774
754extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); 775extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *);
755 776
@@ -823,6 +844,11 @@ static inline unsigned int scsi_host_get_prot(struct Scsi_Host *shost)
823 return shost->prot_capabilities; 844 return shost->prot_capabilities;
824} 845}
825 846
847static inline int scsi_host_prot_dma(struct Scsi_Host *shost)
848{
849 return shost->prot_capabilities >= SHOST_DIX_TYPE0_PROTECTION;
850}
851
826static inline unsigned int scsi_host_dif_capable(struct Scsi_Host *shost, unsigned int target_type) 852static inline unsigned int scsi_host_dif_capable(struct Scsi_Host *shost, unsigned int target_type)
827{ 853{
828 static unsigned char cap[] = { 0, 854 static unsigned char cap[] = { 0,