scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions

The DEF_SCSI_QCMD() macro passes the addresses of the SCSI host lock and
also that of the scsi_done function to the queuecommand_lck() function
implementations. Remove the 'scsi_done' argument since its address is
now a constant and instead call 'scsi_done' directly from inside the
queuecommand_lck() functions.

Link: https://lore.kernel.org/r/20211007204618.2196847-14-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Bart Van Assche 2021-10-07 13:46:14 -07:00 committed by Martin K. Petersen
parent 0feb3429d7
commit af049dfd0b
49 changed files with 75 additions and 103 deletions

View File

@ -1744,8 +1744,9 @@ out:
} /* End twa_scsi_eh_reset() */ } /* End twa_scsi_eh_reset() */
/* This is the main scsi queue function to handle scsi opcodes */ /* This is the main scsi queue function to handle scsi opcodes */
static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt)
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
int request_id, retval; int request_id, retval;
TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata;

View File

@ -1450,8 +1450,9 @@ out:
} /* End twl_scsi_eh_reset() */ } /* End twl_scsi_eh_reset() */
/* This is the main scsi queue function to handle scsi opcodes */ /* This is the main scsi queue function to handle scsi opcodes */
static int twl_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) static int twl_scsi_queue_lck(struct scsi_cmnd *SCpnt)
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
int request_id, retval; int request_id, retval;
TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata;

View File

@ -1918,8 +1918,9 @@ static int tw_scsiop_test_unit_ready_complete(TW_Device_Extension *tw_dev, int r
} /* End tw_scsiop_test_unit_ready_complete() */ } /* End tw_scsiop_test_unit_ready_complete() */
/* This is the main scsi queue function to handle scsi opcodes */ /* This is the main scsi queue function to handle scsi opcodes */
static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt)
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
unsigned char *command = SCpnt->cmnd; unsigned char *command = SCpnt->cmnd;
int request_id = 0; int request_id = 0;
int retval = 1; int retval = 1;

View File

@ -1751,8 +1751,7 @@ NCR_700_intr(int irq, void *dev_id)
return IRQ_RETVAL(handled); return IRQ_RETVAL(handled);
} }
static int static int NCR_700_queuecommand_lck(struct scsi_cmnd *SCp)
NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *))
{ {
struct NCR_700_Host_Parameters *hostdata = struct NCR_700_Host_Parameters *hostdata =
(struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0];

View File

@ -2866,9 +2866,9 @@ static int blogic_hostreset(struct scsi_cmnd *SCpnt)
Outgoing Mailbox for execution by the associated Host Adapter. Outgoing Mailbox for execution by the associated Host Adapter.
*/ */
static int blogic_qcmd_lck(struct scsi_cmnd *command, static int blogic_qcmd_lck(struct scsi_cmnd *command)
void (*comp_cb) (struct scsi_cmnd *))
{ {
void (*comp_cb)(struct scsi_cmnd *) = scsi_done;
struct blogic_adapter *adapter = struct blogic_adapter *adapter =
(struct blogic_adapter *) command->device->host->hostdata; (struct blogic_adapter *) command->device->host->hostdata;
struct blogic_tgt_flags *tgt_flags = struct blogic_tgt_flags *tgt_flags =

View File

@ -911,7 +911,7 @@ static int inia100_build_scb(struct orc_host * host, struct orc_scb * scb, struc
* queue the command down to the controller * queue the command down to the controller
*/ */
static int inia100_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) static int inia100_queue_lck(struct scsi_cmnd *cmd)
{ {
struct orc_scb *scb; struct orc_scb *scb;
struct orc_host *host; /* Point to Host adapter control block */ struct orc_host *host; /* Point to Host adapter control block */

View File

@ -8453,8 +8453,7 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp)
* This function always returns 0. Command return status is saved * This function always returns 0. Command return status is saved
* in the 'scp' result field. * in the 'scp' result field.
*/ */
static int static int advansys_queuecommand_lck(struct scsi_cmnd *scp)
advansys_queuecommand_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *))
{ {
struct Scsi_Host *shost = scp->device->host; struct Scsi_Host *shost = scp->device->host;
int asc_res, result = 0; int asc_res, result = 0;

View File

@ -975,10 +975,8 @@ static int aha152x_internal_queue(struct scsi_cmnd *SCpnt,
* queue a command * queue a command
* *
*/ */
static int aha152x_queue_lck(struct scsi_cmnd *SCpnt, static int aha152x_queue_lck(struct scsi_cmnd *SCpnt)
void (*done)(struct scsi_cmnd *))
{ {
WARN_ON_ONCE(done != scsi_done);
return aha152x_internal_queue(SCpnt, NULL, 0); return aha152x_internal_queue(SCpnt, NULL, 0);
} }

View File

@ -315,9 +315,9 @@ static irqreturn_t aha1740_intr_handle(int irq, void *dev_id)
return IRQ_RETVAL(handled); return IRQ_RETVAL(handled);
} }
static int aha1740_queuecommand_lck(struct scsi_cmnd * SCpnt, static int aha1740_queuecommand_lck(struct scsi_cmnd *SCpnt)
void (*done)(struct scsi_cmnd *))
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
unchar direction; unchar direction;
unchar *cmd = (unchar *) SCpnt->cmnd; unchar *cmd = (unchar *) SCpnt->cmnd;
unchar target = scmd_id(SCpnt); unchar target = scmd_id(SCpnt);

View File

@ -572,8 +572,7 @@ ahd_linux_info(struct Scsi_Host *host)
/* /*
* Queue an SCB to the controller. * Queue an SCB to the controller.
*/ */
static int static int ahd_linux_queue_lck(struct scsi_cmnd *cmd)
ahd_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
{ {
struct ahd_softc *ahd; struct ahd_softc *ahd;
struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device); struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device);

View File

@ -518,8 +518,7 @@ ahc_linux_info(struct Scsi_Host *host)
/* /*
* Queue an SCB to the controller. * Queue an SCB to the controller.
*/ */
static int static int ahc_linux_queue_lck(struct scsi_cmnd *cmd)
ahc_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
{ {
struct ahc_softc *ahc; struct ahc_softc *ahc;
struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device); struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device);

View File

@ -3231,8 +3231,7 @@ static void arcmsr_handle_virtual_command(struct AdapterControlBlock *acb,
} }
} }
static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd, static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd)
void (* done)(struct scsi_cmnd *))
{ {
struct Scsi_Host *host = cmd->device->host; struct Scsi_Host *host = cmd->device->host;
struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;

View File

@ -2397,24 +2397,16 @@ acornscsi_intr(int irq, void *dev_id)
*/ */
/* /*
* Function : acornscsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) * Function : acornscsi_queuecmd(struct scsi_cmnd *cmd)
* Purpose : queues a SCSI command * Purpose : queues a SCSI command
* Params : cmd - SCSI command * Params : cmd - SCSI command
* done - function called on completion, with pointer to command descriptor
* Returns : 0, or < 0 on error. * Returns : 0, or < 0 on error.
*/ */
static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt, static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt)
void (*done)(struct scsi_cmnd *))
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata;
if (!done) {
/* there should be some way of rejecting errors like this without panicing... */
panic("scsi%d: queuecommand called with NULL done function [cmd=%p]",
host->host->host_no, SCpnt);
return -EINVAL;
}
#if (DEBUG & DEBUG_NO_WRITE) #if (DEBUG & DEBUG_NO_WRITE)
if (acornscsi_cmdtype(SCpnt->cmnd[0]) == CMD_WRITE && (NO_WRITE & (1 << SCpnt->device->id))) { if (acornscsi_cmdtype(SCpnt->cmnd[0]) == CMD_WRITE && (NO_WRITE & (1 << SCpnt->device->id))) {
printk(KERN_CRIT "scsi%d.%c: WRITE attempted with NO_WRITE flag set\n", printk(KERN_CRIT "scsi%d.%c: WRITE attempted with NO_WRITE flag set\n",

View File

@ -2233,10 +2233,9 @@ static int fas216_queue_command_internal(struct scsi_cmnd *SCpnt,
return result; return result;
} }
static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt, static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt)
void (*done)(struct scsi_cmnd *))
{ {
return fas216_queue_command_internal(SCpnt, done); return fas216_queue_command_internal(SCpnt, scsi_done);
} }
DEF_SCSI_QCMD(fas216_queue_command) DEF_SCSI_QCMD(fas216_queue_command)
@ -2264,8 +2263,7 @@ static void fas216_internal_done(struct scsi_cmnd *SCpnt)
* Returns: scsi result code. * Returns: scsi result code.
* Notes: io_request_lock is held, interrupts are disabled. * Notes: io_request_lock is held, interrupts are disabled.
*/ */
static int fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt, static int fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt)
void (*done)(struct scsi_cmnd *))
{ {
FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
@ -2306,7 +2304,7 @@ static int fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt,
spin_lock_irq(info->host->host_lock); spin_lock_irq(info->host->host_lock);
done(SCpnt); scsi_done(SCpnt);
return 0; return 0;
} }

View File

@ -618,9 +618,9 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id)
* *
* Queue a command to the ATP queue. Called with the host lock held. * Queue a command to the ATP queue. Called with the host lock held.
*/ */
static int atp870u_queuecommand_lck(struct scsi_cmnd *req_p, static int atp870u_queuecommand_lck(struct scsi_cmnd *req_p)
void (*done) (struct scsi_cmnd *))
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
unsigned char c; unsigned char c;
unsigned int m; unsigned int m;
struct atp_unit *dev; struct atp_unit *dev;

View File

@ -1199,9 +1199,9 @@ bfad_im_itnim_work_handler(struct work_struct *work)
/* /*
* Scsi_Host template entry, queue a SCSI command to the BFAD. * Scsi_Host template entry, queue a SCSI command to the BFAD.
*/ */
static int static int bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd)
bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *))
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
struct bfad_im_port_s *im_port = struct bfad_im_port_s *im_port =
(struct bfad_im_port_s *) cmnd->device->host->hostdata[0]; (struct bfad_im_port_s *) cmnd->device->host->hostdata[0];
struct bfad_s *bfad = im_port->bfad; struct bfad_s *bfad = im_port->bfad;

View File

@ -960,8 +960,9 @@ static void build_srb(struct scsi_cmnd *cmd, struct DeviceCtlBlk *dcb,
* and is expected to be held on return. * and is expected to be held on return.
* *
**/ **/
static int dc395x_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) static int dc395x_queue_command_lck(struct scsi_cmnd *cmd)
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
struct DeviceCtlBlk *dcb; struct DeviceCtlBlk *dcb;
struct ScsiReqBlk *srb; struct ScsiReqBlk *srb;
struct AdapterCtlBlk *acb = struct AdapterCtlBlk *acb =

View File

@ -416,7 +416,7 @@ static int adpt_slave_configure(struct scsi_device * device)
return 0; return 0;
} }
static int adpt_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) static int adpt_queue_lck(struct scsi_cmnd *cmd)
{ {
adpt_hba* pHba = NULL; adpt_hba* pHba = NULL;
struct adpt_device* pDev = NULL; /* dpt per device information */ struct adpt_device* pDev = NULL; /* dpt per device information */

View File

@ -952,7 +952,7 @@ static void esp_event_queue_full(struct esp *esp, struct esp_cmd_entry *ent)
scsi_track_queue_full(dev, lp->num_tagged - 1); scsi_track_queue_full(dev, lp->num_tagged - 1);
} }
static int esp_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) static int esp_queuecommand_lck(struct scsi_cmnd *cmd)
{ {
struct scsi_device *dev = cmd->device; struct scsi_device *dev = cmd->device;
struct esp *esp = shost_priv(dev->host); struct esp *esp = shost_priv(dev->host);

View File

@ -420,8 +420,9 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,
* Routine to send a scsi cdb * Routine to send a scsi cdb
* Called with host_lock held and interrupts disabled. * Called with host_lock held and interrupts disabled.
*/ */
static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) static int fnic_queuecommand_lck(struct scsi_cmnd *sc)
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
const int tag = scsi_cmd_to_rq(sc)->tag; const int tag = scsi_cmd_to_rq(sc)->tag;
struct fc_lport *lp = shost_priv(sc->device->host); struct fc_lport *lp = shost_priv(sc->device->host);
struct fc_rport *rport; struct fc_rport *rport;

View File

@ -993,8 +993,7 @@ static int hptiop_reset_comm_mvfrey(struct hptiop_hba *hba)
return 0; return 0;
} }
static int hptiop_queuecommand_lck(struct scsi_cmnd *scp, static int hptiop_queuecommand_lck(struct scsi_cmnd *scp)
void (*done)(struct scsi_cmnd *))
{ {
struct Scsi_Host *host = scp->device->host; struct Scsi_Host *host = scp->device->host;
struct hptiop_hba *hba = (struct hptiop_hba *)host->hostdata; struct hptiop_hba *hba = (struct hptiop_hba *)host->hostdata;

View File

@ -1039,9 +1039,9 @@ static inline u16 lun_from_dev(struct scsi_device *dev)
* @cmnd: struct scsi_cmnd to be executed * @cmnd: struct scsi_cmnd to be executed
* @done: Callback function to be called when cmd is completed * @done: Callback function to be called when cmd is completed
*/ */
static int ibmvscsi_queuecommand_lck(struct scsi_cmnd *cmnd, static int ibmvscsi_queuecommand_lck(struct scsi_cmnd *cmnd)
void (*done) (struct scsi_cmnd *))
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
struct srp_cmd *srp_cmd; struct srp_cmd *srp_cmd;
struct srp_event_struct *evt_struct; struct srp_event_struct *evt_struct;
struct srp_indirect_buf *indirect; struct srp_indirect_buf *indirect;

View File

@ -910,8 +910,7 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd)
return 0; return 0;
} }
static int imm_queuecommand_lck(struct scsi_cmnd *cmd, static int imm_queuecommand_lck(struct scsi_cmnd *cmd)
void (*done)(struct scsi_cmnd *))
{ {
imm_struct *dev = imm_dev(cmd->device->host); imm_struct *dev = imm_dev(cmd->device->host);

View File

@ -2609,8 +2609,7 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c
* will cause the mid layer to call us again later with the command) * will cause the mid layer to call us again later with the command)
*/ */
static int i91u_queuecommand_lck(struct scsi_cmnd *cmd, static int i91u_queuecommand_lck(struct scsi_cmnd *cmd)
void (*done)(struct scsi_cmnd *))
{ {
struct initio_host *host = (struct initio_host *) cmd->device->host->hostdata; struct initio_host *host = (struct initio_host *) cmd->device->host->hostdata;
struct scsi_ctrl_blk *cmnd; struct scsi_ctrl_blk *cmnd;

View File

@ -1035,8 +1035,9 @@ static int ips_eh_reset(struct scsi_cmnd *SC)
/* Linux obtains io_request_lock before calling this function */ /* Linux obtains io_request_lock before calling this function */
/* */ /* */
/****************************************************************************/ /****************************************************************************/
static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)) static int ips_queue_lck(struct scsi_cmnd *SC)
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
ips_ha_t *ha; ips_ha_t *ha;
ips_passthru_t *pt; ips_passthru_t *pt;

View File

@ -66,8 +66,7 @@ static irqreturn_t do_mac53c94_interrupt(int, void *);
static void cmd_done(struct fsc_state *, int result); static void cmd_done(struct fsc_state *, int result);
static void set_dma_cmds(struct fsc_state *, struct scsi_cmnd *); static void set_dma_cmds(struct fsc_state *, struct scsi_cmnd *);
static int mac53c94_queue_lck(struct scsi_cmnd *cmd)
static int mac53c94_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
{ {
struct fsc_state *state; struct fsc_state *state;

View File

@ -370,8 +370,7 @@ mega_runpendq(adapter_t *adapter)
* *
* The command queuing entry point for the mid-layer. * The command queuing entry point for the mid-layer.
*/ */
static int static int megaraid_queue_lck(struct scsi_cmnd *scmd)
megaraid_queue_lck(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *))
{ {
adapter_t *adapter; adapter_t *adapter;
scb_t *scb; scb_t *scb;

View File

@ -1432,9 +1432,9 @@ mbox_post_cmd(adapter_t *adapter, scb_t *scb)
* *
* Queue entry point for mailbox based controllers. * Queue entry point for mailbox based controllers.
*/ */
static int static int megaraid_queue_command_lck(struct scsi_cmnd *scp)
megaraid_queue_command_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *))
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
adapter_t *adapter; adapter_t *adapter;
scb_t *scb; scb_t *scb;
int if_busy; int if_busy;

View File

@ -1621,7 +1621,7 @@ static void cmd_complete(struct mesh_state *ms)
* Called by midlayer with host locked to queue a new * Called by midlayer with host locked to queue a new
* request * request
*/ */
static int mesh_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) static int mesh_queue_lck(struct scsi_cmnd *cmd)
{ {
struct mesh_state *ms; struct mesh_state *ms;

View File

@ -7852,8 +7852,9 @@ static int ncr53c8xx_slave_configure(struct scsi_device *device)
return 0; return 0;
} }
static int ncr53c8xx_queue_command_lck (struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) static int ncr53c8xx_queue_command_lck(struct scsi_cmnd *cmd)
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
struct ncb *np = ((struct host_data *) cmd->device->host->hostdata)->ncb; struct ncb *np = ((struct host_data *) cmd->device->host->hostdata)->ncb;
unsigned long flags; unsigned long flags;
int sts; int sts;

View File

@ -904,9 +904,9 @@ static int nsp32_setup_sg_table(struct scsi_cmnd *SCpnt)
return TRUE; return TRUE;
} }
static int nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt, static int nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt)
void (*done)(struct scsi_cmnd *))
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata;
nsp32_target *target; nsp32_target *target;
nsp32_lunt *cur_lunt; nsp32_lunt *cur_lunt;

View File

@ -181,8 +181,7 @@ static void nsp_scsi_done(struct scsi_cmnd *SCpnt)
scsi_done(SCpnt); scsi_done(SCpnt);
} }
static int nsp_queuecommand_lck(struct scsi_cmnd *SCpnt, static int nsp_queuecommand_lck(struct scsi_cmnd *SCpnt)
void (*done)(struct scsi_cmnd *))
{ {
#ifdef NSP_DEBUG #ifdef NSP_DEBUG
/*unsigned int host_id = SCpnt->device->host->this_id;*/ /*unsigned int host_id = SCpnt->device->host->this_id;*/

View File

@ -537,8 +537,7 @@ SYM53C500_info(struct Scsi_Host *SChost)
return (info_msg); return (info_msg);
} }
static int static int SYM53C500_queue_lck(struct scsi_cmnd *SCpnt)
SYM53C500_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
{ {
int i; int i;
int port_base = SCpnt->device->host->io_port; int port_base = SCpnt->device->host->io_port;

View File

@ -3313,10 +3313,7 @@ static int pmcraid_copy_sglist(
* SCSI_MLQUEUE_DEVICE_BUSY if device is busy * SCSI_MLQUEUE_DEVICE_BUSY if device is busy
* SCSI_MLQUEUE_HOST_BUSY if host is busy * SCSI_MLQUEUE_HOST_BUSY if host is busy
*/ */
static int pmcraid_queuecommand_lck( static int pmcraid_queuecommand_lck(struct scsi_cmnd *scsi_cmd)
struct scsi_cmnd *scsi_cmd,
void (*done) (struct scsi_cmnd *)
)
{ {
struct pmcraid_instance *pinstance; struct pmcraid_instance *pinstance;
struct pmcraid_resource_entry *res; struct pmcraid_resource_entry *res;

View File

@ -786,8 +786,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd)
return 0; return 0;
} }
static int ppa_queuecommand_lck(struct scsi_cmnd *cmd, static int ppa_queuecommand_lck(struct scsi_cmnd *cmd)
void (*done) (struct scsi_cmnd *))
{ {
ppa_struct *dev = ppa_dev(cmd->device->host); ppa_struct *dev = ppa_dev(cmd->device->host);

View File

@ -200,8 +200,7 @@ static int ps3rom_write_request(struct ps3_storage_device *dev,
return 0; return 0;
} }
static int ps3rom_queuecommand_lck(struct scsi_cmnd *cmd, static int ps3rom_queuecommand_lck(struct scsi_cmnd *cmd)
void (*done)(struct scsi_cmnd *))
{ {
struct ps3rom_private *priv = shost_priv(cmd->device->host); struct ps3rom_private *priv = shost_priv(cmd->device->host);
struct ps3_storage_device *dev = priv->dev; struct ps3_storage_device *dev = priv->dev;

View File

@ -689,8 +689,7 @@ qla1280_info(struct Scsi_Host *host)
* handling). Unfortunately, it sometimes calls the scheduler in interrupt * handling). Unfortunately, it sometimes calls the scheduler in interrupt
* context which is a big NO! NO!. * context which is a big NO! NO!.
**************************************************************************/ **************************************************************************/
static int static int qla1280_queuecommand_lck(struct scsi_cmnd *cmd)
qla1280_queuecommand_lck(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
{ {
struct Scsi_Host *host = cmd->device->host; struct Scsi_Host *host = cmd->device->host;
struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata; struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata;

View File

@ -460,9 +460,9 @@ irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id)
* Queued command * Queued command
*/ */
static int qlogicfas408_queuecommand_lck(struct scsi_cmnd *cmd, static int qlogicfas408_queuecommand_lck(struct scsi_cmnd *cmd)
void (*done) (struct scsi_cmnd *))
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd); struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd);
set_host_byte(cmd, DID_OK); set_host_byte(cmd, DID_OK);

View File

@ -1013,8 +1013,9 @@ static int qlogicpti_slave_configure(struct scsi_device *sdev)
* *
* "This code must fly." -davem * "This code must fly." -davem
*/ */
static int qlogicpti_queuecommand_lck(struct scsi_cmnd *Cmnd, void (*done)(struct scsi_cmnd *)) static int qlogicpti_queuecommand_lck(struct scsi_cmnd *Cmnd)
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
struct Scsi_Host *host = Cmnd->device->host; struct Scsi_Host *host = Cmnd->device->host;
struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata; struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata;
struct Command_Entry *cmd; struct Command_Entry *cmd;

View File

@ -590,9 +590,9 @@ stex_slave_config(struct scsi_device *sdev)
return 0; return 0;
} }
static int static int stex_queuecommand_lck(struct scsi_cmnd *cmd)
stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
struct st_hba *hba; struct st_hba *hba;
struct Scsi_Host *host; struct Scsi_Host *host;
unsigned int id, lun; unsigned int id, lun;

View File

@ -486,8 +486,7 @@ void sym_log_bus_error(struct Scsi_Host *shost)
* queuecommand method. Entered with the host adapter lock held and * queuecommand method. Entered with the host adapter lock held and
* interrupts disabled. * interrupts disabled.
*/ */
static int sym53c8xx_queue_command_lck(struct scsi_cmnd *cmd, static int sym53c8xx_queue_command_lck(struct scsi_cmnd *cmd)
void (*done)(struct scsi_cmnd *))
{ {
struct sym_hcb *np = SYM_SOFTC_PTR(cmd); struct sym_hcb *np = SYM_SOFTC_PTR(cmd);
struct sym_ucmd *ucp = SYM_UCMD_PTR(cmd); struct sym_ucmd *ucp = SYM_UCMD_PTR(cmd);

View File

@ -768,7 +768,7 @@ static int pvscsi_queue_ring(struct pvscsi_adapter *adapter,
return 0; return 0;
} }
static int pvscsi_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) static int pvscsi_queue_lck(struct scsi_cmnd *cmd)
{ {
struct Scsi_Host *host = cmd->device->host; struct Scsi_Host *host = cmd->device->host;
struct pvscsi_adapter *adapter = shost_priv(host); struct pvscsi_adapter *adapter = shost_priv(host);

View File

@ -362,9 +362,7 @@ calc_sync_msg(unsigned int period, unsigned int offset, unsigned int fast,
msg[1] = offset; msg[1] = offset;
} }
static int static int wd33c93_queuecommand_lck(struct scsi_cmnd *cmd)
wd33c93_queuecommand_lck(struct scsi_cmnd *cmd,
void (*done)(struct scsi_cmnd *))
{ {
struct WD33C93_hostdata *hostdata; struct WD33C93_hostdata *hostdata;
struct scsi_cmnd *tmp; struct scsi_cmnd *tmp;

View File

@ -118,9 +118,9 @@ static int slave_configure(struct scsi_device *sdev)
/* queue a command */ /* queue a command */
/* This is always called with scsi_lock(host) held */ /* This is always called with scsi_lock(host) held */
static int queuecommand_lck(struct scsi_cmnd *srb, static int queuecommand_lck(struct scsi_cmnd *srb)
void (*done)(struct scsi_cmnd *))
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
struct rtsx_dev *dev = host_to_rtsx(srb->device->host); struct rtsx_dev *dev = host_to_rtsx(srb->device->host);
struct rtsx_chip *chip = dev->chip; struct rtsx_chip *chip = dev->chip;

View File

@ -446,10 +446,9 @@ static u32 dma_data_dir_linux_to_spar(enum dma_data_direction d)
* Return: 0 if successfully queued to the Service Partition, otherwise * Return: 0 if successfully queued to the Service Partition, otherwise
* error code * error code
*/ */
static int visorhba_queue_command_lck(struct scsi_cmnd *scsicmd, static int visorhba_queue_command_lck(struct scsi_cmnd *scsicmd)
void (*visorhba_cmnd_done)
(struct scsi_cmnd *))
{ {
void (*visorhba_cmnd_done)(struct scsi_cmnd *) = scsi_done;
struct uiscmdrsp *cmdrsp; struct uiscmdrsp *cmdrsp;
struct scsi_device *scsidev = scsicmd->device; struct scsi_device *scsidev = scsicmd->device;
int insert_location; int insert_location;

View File

@ -561,10 +561,9 @@ mts_build_transfer_context(struct scsi_cmnd *srb, struct mts_desc* desc)
desc->context.data_pipe = pipe; desc->context.data_pipe = pipe;
} }
static int mts_scsi_queuecommand_lck(struct scsi_cmnd *srb)
static int
mts_scsi_queuecommand_lck(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback)
{ {
mts_scsi_cmnd_callback callback = scsi_done;
struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]); struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]);
int res; int res;

View File

@ -363,9 +363,9 @@ static int target_alloc(struct scsi_target *starget)
/* queue a command */ /* queue a command */
/* This is always called with scsi_lock(host) held */ /* This is always called with scsi_lock(host) held */
static int queuecommand_lck(struct scsi_cmnd *srb, static int queuecommand_lck(struct scsi_cmnd *srb)
void (*done)(struct scsi_cmnd *))
{ {
void (*done)(struct scsi_cmnd *) = scsi_done;
struct us_data *us = host_to_us(srb->device->host); struct us_data *us = host_to_us(srb->device->host);
/* check for state-transition errors */ /* check for state-transition errors */

View File

@ -633,8 +633,7 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd,
return 0; return 0;
} }
static int uas_queuecommand_lck(struct scsi_cmnd *cmnd, static int uas_queuecommand_lck(struct scsi_cmnd *cmnd)
void (*done)(struct scsi_cmnd *))
{ {
struct scsi_device *sdev = cmnd->device; struct scsi_device *sdev = cmnd->device;
struct uas_dev_info *devinfo = sdev->hostdata; struct uas_dev_info *devinfo = sdev->hostdata;

View File

@ -516,7 +516,7 @@ struct scsi_host_template {
unsigned long irq_flags; \ unsigned long irq_flags; \
int rc; \ int rc; \
spin_lock_irqsave(shost->host_lock, irq_flags); \ spin_lock_irqsave(shost->host_lock, irq_flags); \
rc = func_name##_lck(cmd, scsi_done); \ rc = func_name##_lck(cmd); \
spin_unlock_irqrestore(shost->host_lock, irq_flags); \ spin_unlock_irqrestore(shost->host_lock, irq_flags); \
return rc; \ return rc; \
} }