#include <linux/workqueue.h>
#include <linux/mutex.h>
#include <linux/seq_file.h>
+#include <linux/blk-mq.h>
#include <scsi/scsi.h>
struct request_queue;
*/
int (* queuecommand)(struct Scsi_Host *, struct scsi_cmnd *);
- /*
- * The transfer functions are used to queue a scsi command to
- * the LLD. When the driver is finished processing the command
- * the done callback is invoked.
- *
- * This is called to inform the LLD to transfer
- * scsi_bufflen(cmd) bytes. scsi_sg_count(cmd) speciefies the
- * number of scatterlist entried in the command and
- * scsi_sglist(cmd) returns the scatterlist.
- *
- * return values: see queuecommand
- *
- * If the LLD accepts the cmd, it should set the result to an
- * appropriate value when completed before calling the done function.
- *
- * STATUS: REQUIRED FOR TARGET DRIVERS
- */
- /* TODO: rename */
- int (* transfer_response)(struct scsi_cmnd *,
- void (*done)(struct scsi_cmnd *));
-
/*
* This is an error handling strategy routine. You don't need to
* define one of these if you don't want to - there is a default
/*
* Set this if the host adapter has limitations beside segment count.
*/
- unsigned short max_sectors;
+ unsigned int max_sectors;
/*
* DMA scatter gather segment boundary limit. A segment crossing this
*/
unsigned int cmd_size;
struct scsi_host_cmd_pool *cmd_pool;
+
+ /* temporary flag to disable blk-mq I/O path */
+ bool disable_blk_mq;
};
/*
* Area to keep a shared tag map (if needed, will be
* NULL if not).
*/
- struct blk_queue_tag *bqt;
+ union {
+ struct blk_queue_tag *bqt;
+ struct blk_mq_tag_set tag_set;
+ };
- /*
- * The following two fields are protected with host_lock;
- * however, eh routines can safely access during eh processing
- * without acquiring the lock.
- */
- unsigned int host_busy; /* commands actually active on low-level */
- unsigned int host_failed; /* commands that failed. */
+ atomic_t host_busy; /* commands actually active on low-level */
+ atomic_t host_blocked;
+
+ unsigned int host_failed; /* commands that failed.
+ protected by host_lock */
unsigned int host_eh_scheduled; /* EH scheduled without command */
unsigned int host_no; /* Used for IOCTL_GET_IDLUN, /proc/scsi et al. */
* These three parameters can be used to allow for wide scsi,
* and for host adapters that support multiple busses
* The first two should be set to 1 more than the actual max id
- * or lun (i.e. 8 for normal systems).
+ * or lun (e.g. 8 for SCSI parallel systems).
*/
- unsigned int max_id;
- unsigned int max_lun;
unsigned int max_channel;
+ unsigned int max_id;
+ u64 max_lun;
/*
* This is a unique identifier that must be assigned so that we
short cmd_per_lun;
short unsigned int sg_tablesize;
short unsigned int sg_prot_tablesize;
- short unsigned int max_sectors;
+ unsigned int max_sectors;
unsigned long dma_boundary;
/*
* Used to assign serial numbers to the cmds.
/* The controller does not support WRITE SAME */
unsigned no_write_same:1;
+ unsigned use_blk_mq:1;
+
/*
* Optional work queue to be utilized by the transport
*/
*/
struct workqueue_struct *tmf_work_q;
- /*
- * Host has rejected a command because it was busy.
- */
- unsigned int host_blocked;
-
/*
* Value host_blocked counts down from
*/
shost->tmf_in_progress;
}
+extern bool scsi_use_blk_mq;
+
+static inline bool shost_use_blk_mq(struct Scsi_Host *shost)
+{
+ return shost->use_blk_mq;
+}
+
extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *);
extern void scsi_flush_work(struct Scsi_Host *);
extern const char *scsi_host_state_name(enum scsi_host_state);
extern void scsi_cmd_get_serial(struct Scsi_Host *, struct scsi_cmnd *);
-extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *);
-
static inline int __must_check scsi_add_host(struct Scsi_Host *host,
struct device *dev)
{