SCSI host lock push-down

Move the mid-layer's ->queuecommand() invocation from being locked
with the host lock to being unlocked to facilitate speeding up the
critical path for drivers who don't need this lock taken anyway.

The patch below presents a simple SCSI host lock push-down as an
equivalent transformation. No locking or other behavior should change
with this patch. All existing bugs and locking orders are preserved.

Additionally, add one parameter to queuecommand,
struct Scsi_Host *
and remove one parameter from queuecommand,
void (*done)(struct scsi_cmnd *)

Scsi_Host* is a convenient pointer that most host drivers need anyway,
and 'done' is redundant to struct scsi_cmnd->scsi_done.

Minimal code disturbance was attempted with this change. Most drivers
needed only two one-line modifications for their host lock push-down.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Jeff Garzik and committed by Linus Torvalds f281233d bdbd01ac

+347 -199
+3 -1
arch/ia64/hp/sim/simscsi.c
··· 202 } 203 204 static int 205 - simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) 206 { 207 unsigned int target_id = sc->device->id; 208 char fname[MAX_ROOT_LEN+16]; ··· 325 tasklet_schedule(&simscsi_tasklet); 326 return 0; 327 } 328 329 static int 330 simscsi_host_reset (struct scsi_cmnd *sc)
··· 202 } 203 204 static int 205 + simscsi_queuecommand_lck (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) 206 { 207 unsigned int target_id = sc->device->id; 208 char fname[MAX_ROOT_LEN+16]; ··· 325 tasklet_schedule(&simscsi_tasklet); 326 return 0; 327 } 328 + 329 + static DEF_SCSI_QCMD(simscsi_queuecommand) 330 331 static int 332 simscsi_host_reset (struct scsi_cmnd *sc)
+3 -1
drivers/ata/libata-scsi.c
··· 3183 * Return value from __ata_scsi_queuecmd() if @cmd can be queued, 3184 * 0 otherwise. 3185 */ 3186 - int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 3187 { 3188 struct ata_port *ap; 3189 struct ata_device *dev; ··· 3210 spin_lock(shost->host_lock); 3211 return rc; 3212 } 3213 3214 /** 3215 * ata_scsi_simulate - simulate SCSI command on ATA device
··· 3183 * Return value from __ata_scsi_queuecmd() if @cmd can be queued, 3184 * 0 otherwise. 3185 */ 3186 + static int ata_scsi_queuecmd_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 3187 { 3188 struct ata_port *ap; 3189 struct ata_device *dev; ··· 3210 spin_lock(shost->host_lock); 3211 return rc; 3212 } 3213 + 3214 + DEF_SCSI_QCMD(ata_scsi_queuecmd) 3215 3216 /** 3217 * ata_scsi_simulate - simulate SCSI command on ATA device
+5 -3
drivers/block/cciss_scsi.c
··· 62 int length, /* length of data in buffer */ 63 int func); /* 0 == read, 1 == write */ 64 65 - static int cciss_scsi_queue_command (struct scsi_cmnd *cmd, 66 - void (* done)(struct scsi_cmnd *)); 67 static int cciss_eh_device_reset_handler(struct scsi_cmnd *); 68 static int cciss_eh_abort_handler(struct scsi_cmnd *); 69 ··· 1406 1407 1408 static int 1409 - cciss_scsi_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *)) 1410 { 1411 ctlr_info_t *h; 1412 int rc; ··· 1503 /* the cmd'll come back via intr handler in complete_scsi_command() */ 1504 return 0; 1505 } 1506 1507 static void cciss_unregister_scsi(ctlr_info_t *h) 1508 {
··· 62 int length, /* length of data in buffer */ 63 int func); /* 0 == read, 1 == write */ 64 65 + static int cciss_scsi_queue_command (struct Scsi_Host *h, 66 + struct scsi_cmnd *cmd); 67 static int cciss_eh_device_reset_handler(struct scsi_cmnd *); 68 static int cciss_eh_abort_handler(struct scsi_cmnd *); 69 ··· 1406 1407 1408 static int 1409 + cciss_scsi_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 1410 { 1411 ctlr_info_t *h; 1412 int rc; ··· 1503 /* the cmd'll come back via intr handler in complete_scsi_command() */ 1504 return 0; 1505 } 1506 + 1507 + static DEF_SCSI_QCMD(cciss_scsi_queue_command) 1508 1509 static void cciss_unregister_scsi(ctlr_info_t *h) 1510 {
+3 -1
drivers/firewire/sbp2.c
··· 1468 1469 /* SCSI stack integration */ 1470 1471 - static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done) 1472 { 1473 struct sbp2_logical_unit *lu = cmd->device->hostdata; 1474 struct fw_device *device = target_device(lu->tgt); ··· 1533 kref_put(&orb->base.kref, free_orb); 1534 return retval; 1535 } 1536 1537 static int sbp2_scsi_slave_alloc(struct scsi_device *sdev) 1538 {
··· 1468 1469 /* SCSI stack integration */ 1470 1471 + static int sbp2_scsi_queuecommand_lck(struct scsi_cmnd *cmd, scsi_done_fn_t done) 1472 { 1473 struct sbp2_logical_unit *lu = cmd->device->hostdata; 1474 struct fw_device *device = target_device(lu->tgt); ··· 1533 kref_put(&orb->base.kref, free_orb); 1534 return retval; 1535 } 1536 + 1537 + static DEF_SCSI_QCMD(sbp2_scsi_queuecommand) 1538 1539 static int sbp2_scsi_slave_alloc(struct scsi_device *sdev) 1540 {
+3 -1
drivers/infiniband/ulp/srp/ib_srp.c
··· 1123 } 1124 } 1125 1126 - static int srp_queuecommand(struct scsi_cmnd *scmnd, 1127 void (*done)(struct scsi_cmnd *)) 1128 { 1129 struct srp_target_port *target = host_to_target(scmnd->device->host); ··· 1195 err: 1196 return SCSI_MLQUEUE_HOST_BUSY; 1197 } 1198 1199 static int srp_alloc_iu_bufs(struct srp_target_port *target) 1200 {
··· 1123 } 1124 } 1125 1126 + static int srp_queuecommand_lck(struct scsi_cmnd *scmnd, 1127 void (*done)(struct scsi_cmnd *)) 1128 { 1129 struct srp_target_port *target = host_to_target(scmnd->device->host); ··· 1195 err: 1196 return SCSI_MLQUEUE_HOST_BUSY; 1197 } 1198 + 1199 + static DEF_SCSI_QCMD(srp_queuecommand) 1200 1201 static int srp_alloc_iu_bufs(struct srp_target_port *target) 1202 {
+4 -3
drivers/message/fusion/mptfc.c
··· 97 98 static int mptfc_target_alloc(struct scsi_target *starget); 99 static int mptfc_slave_alloc(struct scsi_device *sdev); 100 - static int mptfc_qcmd(struct scsi_cmnd *SCpnt, 101 - void (*done)(struct scsi_cmnd *)); 102 static void mptfc_target_destroy(struct scsi_target *starget); 103 static void mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout); 104 static void __devexit mptfc_remove(struct pci_dev *pdev); ··· 649 } 650 651 static int 652 - mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 653 { 654 struct mptfc_rport_info *ri; 655 struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device)); ··· 679 680 return mptscsih_qcmd(SCpnt,done); 681 } 682 683 /* 684 * mptfc_display_port_link_speed - displaying link speed
··· 97 98 static int mptfc_target_alloc(struct scsi_target *starget); 99 static int mptfc_slave_alloc(struct scsi_device *sdev); 100 + static int mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt); 101 static void mptfc_target_destroy(struct scsi_target *starget); 102 static void mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout); 103 static void __devexit mptfc_remove(struct pci_dev *pdev); ··· 650 } 651 652 static int 653 + mptfc_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 654 { 655 struct mptfc_rport_info *ri; 656 struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device)); ··· 680 681 return mptscsih_qcmd(SCpnt,done); 682 } 683 + 684 + static DEF_SCSI_QCMD(mptfc_qcmd) 685 686 /* 687 * mptfc_display_port_link_speed - displaying link speed
+3 -1
drivers/message/fusion/mptsas.c
··· 1889 } 1890 1891 static int 1892 - mptsas_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1893 { 1894 MPT_SCSI_HOST *hd; 1895 MPT_ADAPTER *ioc; ··· 1912 1913 return mptscsih_qcmd(SCpnt,done); 1914 } 1915 1916 /** 1917 * mptsas_mptsas_eh_timed_out - resets the scsi_cmnd timeout
··· 1889 } 1890 1891 static int 1892 + mptsas_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1893 { 1894 MPT_SCSI_HOST *hd; 1895 MPT_ADAPTER *ioc; ··· 1912 1913 return mptscsih_qcmd(SCpnt,done); 1914 } 1915 + 1916 + static DEF_SCSI_QCMD(mptsas_qcmd) 1917 1918 /** 1919 * mptsas_mptsas_eh_timed_out - resets the scsi_cmnd timeout
+3 -1
drivers/message/fusion/mptspi.c
··· 780 } 781 782 static int 783 - mptspi_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 784 { 785 struct _MPT_SCSI_HOST *hd = shost_priv(SCpnt->device->host); 786 VirtDevice *vdevice = SCpnt->device->hostdata; ··· 804 805 return mptscsih_qcmd(SCpnt,done); 806 } 807 808 static void mptspi_slave_destroy(struct scsi_device *sdev) 809 {
··· 780 } 781 782 static int 783 + mptspi_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 784 { 785 struct _MPT_SCSI_HOST *hd = shost_priv(SCpnt->device->host); 786 VirtDevice *vdevice = SCpnt->device->hostdata; ··· 804 805 return mptscsih_qcmd(SCpnt,done); 806 } 807 + 808 + static DEF_SCSI_QCMD(mptspi_qcmd) 809 810 static void mptspi_slave_destroy(struct scsi_device *sdev) 811 {
+4 -2
drivers/message/i2o/i2o_scsi.c
··· 506 * Locks: takes the controller lock on error path only 507 */ 508 509 - static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt, 510 void (*done) (struct scsi_cmnd *)) 511 { 512 struct i2o_controller *c; ··· 688 689 exit: 690 return rc; 691 - }; 692 693 /** 694 * i2o_scsi_abort - abort a running command
··· 506 * Locks: takes the controller lock on error path only 507 */ 508 509 + static int i2o_scsi_queuecommand_lck(struct scsi_cmnd *SCpnt, 510 void (*done) (struct scsi_cmnd *)) 511 { 512 struct i2o_controller *c; ··· 688 689 exit: 690 return rc; 691 + } 692 + 693 + static DEF_SCSI_QCMD(i2o_scsi_queuecommand) 694 695 /** 696 * i2o_scsi_abort - abort a running command
+3 -1
drivers/s390/scsi/zfcp_scsi.c
··· 76 scpnt->scsi_done(scpnt); 77 } 78 79 - static int zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt, 80 void (*done) (struct scsi_cmnd *)) 81 { 82 struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(scpnt->device); ··· 126 127 return ret; 128 } 129 130 static int zfcp_scsi_slave_alloc(struct scsi_device *sdev) 131 {
··· 76 scpnt->scsi_done(scpnt); 77 } 78 79 + static int zfcp_scsi_queuecommand_lck(struct scsi_cmnd *scpnt, 80 void (*done) (struct scsi_cmnd *)) 81 { 82 struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(scpnt->device); ··· 126 127 return ret; 128 } 129 + 130 + static DEF_SCSI_QCMD(zfcp_scsi_queuecommand) 131 132 static int zfcp_scsi_slave_alloc(struct scsi_device *sdev) 133 {
+3 -1
drivers/scsi/3w-9xxx.c
··· 1765 } /* End twa_scsi_eh_reset() */ 1766 1767 /* This is the main scsi queue function to handle scsi opcodes */ 1768 - static int twa_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1769 { 1770 int request_id, retval; 1771 TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; ··· 1811 out: 1812 return retval; 1813 } /* End twa_scsi_queue() */ 1814 1815 /* This function hands scsi cdb's to the firmware */ 1816 static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry *sglistarg)
··· 1765 } /* End twa_scsi_eh_reset() */ 1766 1767 /* This is the main scsi queue function to handle scsi opcodes */ 1768 + static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1769 { 1770 int request_id, retval; 1771 TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; ··· 1811 out: 1812 return retval; 1813 } /* End twa_scsi_queue() */ 1814 + 1815 + static DEF_SCSI_QCMD(twa_scsi_queue) 1816 1817 /* This function hands scsi cdb's to the firmware */ 1818 static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry *sglistarg)
+3 -1
drivers/scsi/3w-sas.c
··· 1501 } /* End twl_scsi_eh_reset() */ 1502 1503 /* This is the main scsi queue function to handle scsi opcodes */ 1504 - static int twl_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1505 { 1506 int request_id, retval; 1507 TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; ··· 1535 out: 1536 return retval; 1537 } /* End twl_scsi_queue() */ 1538 1539 /* This function tells the controller to shut down */ 1540 static void __twl_shutdown(TW_Device_Extension *tw_dev)
··· 1501 } /* End twl_scsi_eh_reset() */ 1502 1503 /* This is the main scsi queue function to handle scsi opcodes */ 1504 + static int twl_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1505 { 1506 int request_id, retval; 1507 TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; ··· 1535 out: 1536 return retval; 1537 } /* End twl_scsi_queue() */ 1538 + 1539 + static DEF_SCSI_QCMD(twl_scsi_queue) 1540 1541 /* This function tells the controller to shut down */ 1542 static void __twl_shutdown(TW_Device_Extension *tw_dev)
+3 -1
drivers/scsi/3w-xxxx.c
··· 1947 } /* End tw_scsiop_test_unit_ready_complete() */ 1948 1949 /* This is the main scsi queue function to handle scsi opcodes */ 1950 - static int tw_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1951 { 1952 unsigned char *command = SCpnt->cmnd; 1953 int request_id = 0; ··· 2022 } 2023 return retval; 2024 } /* End tw_scsi_queue() */ 2025 2026 /* This function is the interrupt service routine */ 2027 static irqreturn_t tw_interrupt(int irq, void *dev_instance)
··· 1947 } /* End tw_scsiop_test_unit_ready_complete() */ 1948 1949 /* This is the main scsi queue function to handle scsi opcodes */ 1950 + static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1951 { 1952 unsigned char *command = SCpnt->cmnd; 1953 int request_id = 0; ··· 2022 } 2023 return retval; 2024 } /* End tw_scsi_queue() */ 2025 + 2026 + static DEF_SCSI_QCMD(tw_scsi_queue) 2027 2028 /* This function is the interrupt service routine */ 2029 static irqreturn_t tw_interrupt(int irq, void *dev_instance)
+5 -3
drivers/scsi/53c700.c
··· 167 #include "53c700_d.h" 168 169 170 - STATIC int NCR_700_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); 171 STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt); 172 STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt); 173 STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt); ··· 1749 return IRQ_RETVAL(handled); 1750 } 1751 1752 - STATIC int 1753 - NCR_700_queuecommand(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)) 1754 { 1755 struct NCR_700_Host_Parameters *hostdata = 1756 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; ··· 1903 NCR_700_start_command(SCp); 1904 return 0; 1905 } 1906 1907 STATIC int 1908 NCR_700_abort(struct scsi_cmnd * SCp)
··· 167 #include "53c700_d.h" 168 169 170 + STATIC int NCR_700_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *); 171 STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt); 172 STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt); 173 STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt); ··· 1749 return IRQ_RETVAL(handled); 1750 } 1751 1752 + static int 1753 + NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)) 1754 { 1755 struct NCR_700_Host_Parameters *hostdata = 1756 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; ··· 1903 NCR_700_start_command(SCp); 1904 return 0; 1905 } 1906 + 1907 + STATIC DEF_SCSI_QCMD(NCR_700_queuecommand) 1908 1909 STATIC int 1910 NCR_700_abort(struct scsi_cmnd * SCp)
+2 -1
drivers/scsi/BusLogic.c
··· 2807 Outgoing Mailbox for execution by the associated Host Adapter. 2808 */ 2809 2810 - static int BusLogic_QueueCommand(struct scsi_cmnd *Command, void (*CompletionRoutine) (struct scsi_cmnd *)) 2811 { 2812 struct BusLogic_HostAdapter *HostAdapter = (struct BusLogic_HostAdapter *) Command->device->host->hostdata; 2813 struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[Command->device->id]; ··· 2994 return 0; 2995 } 2996 2997 2998 #if 0 2999 /*
··· 2807 Outgoing Mailbox for execution by the associated Host Adapter. 2808 */ 2809 2810 + static int BusLogic_QueueCommand_lck(struct scsi_cmnd *Command, void (*CompletionRoutine) (struct scsi_cmnd *)) 2811 { 2812 struct BusLogic_HostAdapter *HostAdapter = (struct BusLogic_HostAdapter *) Command->device->host->hostdata; 2813 struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[Command->device->id]; ··· 2994 return 0; 2995 } 2996 2997 + static DEF_SCSI_QCMD(BusLogic_QueueCommand) 2998 2999 #if 0 3000 /*
+1 -1
drivers/scsi/BusLogic.h
··· 1319 */ 1320 1321 static const char *BusLogic_DriverInfo(struct Scsi_Host *); 1322 - static int BusLogic_QueueCommand(struct scsi_cmnd *, void (*CompletionRoutine) (struct scsi_cmnd *)); 1323 static int BusLogic_BIOSDiskParameters(struct scsi_device *, struct block_device *, sector_t, int *); 1324 static int BusLogic_ProcDirectoryInfo(struct Scsi_Host *, char *, char **, off_t, int, int); 1325 static int BusLogic_SlaveConfigure(struct scsi_device *);
··· 1319 */ 1320 1321 static const char *BusLogic_DriverInfo(struct Scsi_Host *); 1322 + static int BusLogic_QueueCommand(struct Scsi_Host *h, struct scsi_cmnd *); 1323 static int BusLogic_BIOSDiskParameters(struct scsi_device *, struct block_device *, sector_t, int *); 1324 static int BusLogic_ProcDirectoryInfo(struct Scsi_Host *, char *, char **, off_t, int, int); 1325 static int BusLogic_SlaveConfigure(struct scsi_device *);
+2 -1
drivers/scsi/NCR5380.c
··· 952 * Locks: host lock taken by caller 953 */ 954 955 - static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) 956 { 957 struct Scsi_Host *instance = cmd->device->host; 958 struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; ··· 1021 return 0; 1022 } 1023 1024 1025 /** 1026 * NCR5380_main - NCR state machines
··· 952 * Locks: host lock taken by caller 953 */ 954 955 + static int NCR5380_queue_command_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) 956 { 957 struct Scsi_Host *instance = cmd->device->host; 958 struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; ··· 1021 return 0; 1022 } 1023 1024 + static DEF_SCSI_QCMD(NCR5380_queue_command) 1025 1026 /** 1027 * NCR5380_main - NCR state machines
+1 -1
drivers/scsi/NCR5380.h
··· 313 #endif 314 static int NCR5380_abort(Scsi_Cmnd * cmd); 315 static int NCR5380_bus_reset(Scsi_Cmnd * cmd); 316 - static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)); 317 static int __maybe_unused NCR5380_proc_info(struct Scsi_Host *instance, 318 char *buffer, char **start, off_t offset, int length, int inout); 319
··· 313 #endif 314 static int NCR5380_abort(Scsi_Cmnd * cmd); 315 static int NCR5380_bus_reset(Scsi_Cmnd * cmd); 316 + static int NCR5380_queue_command(struct Scsi_Host *, struct scsi_cmnd *); 317 static int __maybe_unused NCR5380_proc_info(struct Scsi_Host *instance, 318 char *buffer, char **start, off_t offset, int length, int inout); 319
+3 -1
drivers/scsi/NCR53c406a.c
··· 693 } 694 #endif 695 696 - static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) 697 { 698 int i; 699 ··· 725 rtrc(1); 726 return 0; 727 } 728 729 static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt) 730 {
··· 693 } 694 #endif 695 696 + static int NCR53c406a_queue_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) 697 { 698 int i; 699 ··· 725 rtrc(1); 726 return 0; 727 } 728 + 729 + static DEF_SCSI_QCMD(NCR53c406a_queue) 730 731 static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt) 732 {
+3 -1
drivers/scsi/a100u2w.c
··· 911 * queue the command down to the controller 912 */ 913 914 - static int inia100_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) 915 { 916 struct orc_scb *scb; 917 struct orc_host *host; /* Point to Host adapter control block */ ··· 929 orc_exec_scb(host, scb); /* Start execute SCB */ 930 return 0; 931 } 932 933 /***************************************************************************** 934 Function name : inia100_abort
··· 911 * queue the command down to the controller 912 */ 913 914 + static int inia100_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) 915 { 916 struct orc_scb *scb; 917 struct orc_host *host; /* Point to Host adapter control block */ ··· 929 orc_exec_scb(host, scb); /* Start execute SCB */ 930 return 0; 931 } 932 + 933 + static DEF_SCSI_QCMD(inia100_queue) 934 935 /***************************************************************************** 936 Function name : inia100_abort
+3 -1
drivers/scsi/aacraid/linit.c
··· 248 * TODO: unify with aac_scsi_cmd(). 249 */ 250 251 - static int aac_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 252 { 253 struct Scsi_Host *host = cmd->device->host; 254 struct aac_dev *dev = (struct aac_dev *)host->hostdata; ··· 266 cmd->SCp.phase = AAC_OWNER_LOWLEVEL; 267 return (aac_scsi_cmd(cmd) ? FAILED : 0); 268 } 269 270 /** 271 * aac_info - Returns the host adapter name
··· 248 * TODO: unify with aac_scsi_cmd(). 249 */ 250 251 + static int aac_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 252 { 253 struct Scsi_Host *host = cmd->device->host; 254 struct aac_dev *dev = (struct aac_dev *)host->hostdata; ··· 266 cmd->SCp.phase = AAC_OWNER_LOWLEVEL; 267 return (aac_scsi_cmd(cmd) ? FAILED : 0); 268 } 269 + 270 + static DEF_SCSI_QCMD(aac_queuecommand) 271 272 /** 273 * aac_info - Returns the host adapter name
+3 -1
drivers/scsi/advansys.c
··· 9500 * in the 'scp' result field. 9501 */ 9502 static int 9503 - advansys_queuecommand(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) 9504 { 9505 struct Scsi_Host *shost = scp->device->host; 9506 int asc_res, result = 0; ··· 9524 9525 return result; 9526 } 9527 9528 static ushort __devinit AscGetEisaChipCfg(PortAddr iop_base) 9529 {
··· 9500 * in the 'scp' result field. 9501 */ 9502 static int 9503 + advansys_queuecommand_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) 9504 { 9505 struct Scsi_Host *shost = scp->device->host; 9506 int asc_res, result = 0; ··· 9524 9525 return result; 9526 } 9527 + 9528 + static DEF_SCSI_QCMD(advansys_queuecommand) 9529 9530 static ushort __devinit AscGetEisaChipCfg(PortAddr iop_base) 9531 {
+3 -1
drivers/scsi/aha152x.c
··· 1056 * queue a command 1057 * 1058 */ 1059 - static int aha152x_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 1060 { 1061 #if 0 1062 if(*SCpnt->cmnd == REQUEST_SENSE) { ··· 1069 1070 return aha152x_internal_queue(SCpnt, NULL, 0, done); 1071 } 1072 1073 1074 /*
··· 1056 * queue a command 1057 * 1058 */ 1059 + static int aha152x_queue_lck(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 1060 { 1061 #if 0 1062 if(*SCpnt->cmnd == REQUEST_SENSE) { ··· 1069 1070 return aha152x_internal_queue(SCpnt, NULL, 0, done); 1071 } 1072 + 1073 + static DEF_SCSI_QCMD(aha152x_queue) 1074 1075 1076 /*
+3 -1
drivers/scsi/aha1542.c
··· 558 }; 559 } 560 561 - static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) 562 { 563 unchar ahacmd = CMD_START_SCSI; 564 unchar direction; ··· 717 718 return 0; 719 } 720 721 /* Initialize mailboxes */ 722 static void setup_mailboxes(int bse, struct Scsi_Host *shpnt)
··· 558 }; 559 } 560 561 + static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) 562 { 563 unchar ahacmd = CMD_START_SCSI; 564 unchar direction; ··· 717 718 return 0; 719 } 720 + 721 + static DEF_SCSI_QCMD(aha1542_queuecommand) 722 723 /* Initialize mailboxes */ 724 static void setup_mailboxes(int bse, struct Scsi_Host *shpnt)
+1 -1
drivers/scsi/aha1542.h
··· 132 }; 133 134 static int aha1542_detect(struct scsi_host_template *); 135 - static int aha1542_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 136 static int aha1542_bus_reset(Scsi_Cmnd * SCpnt); 137 static int aha1542_dev_reset(Scsi_Cmnd * SCpnt); 138 static int aha1542_host_reset(Scsi_Cmnd * SCpnt);
··· 132 }; 133 134 static int aha1542_detect(struct scsi_host_template *); 135 + static int aha1542_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 136 static int aha1542_bus_reset(Scsi_Cmnd * SCpnt); 137 static int aha1542_dev_reset(Scsi_Cmnd * SCpnt); 138 static int aha1542_host_reset(Scsi_Cmnd * SCpnt);
+3 -1
drivers/scsi/aha1740.c
··· 331 return IRQ_RETVAL(handled); 332 } 333 334 - static int aha1740_queuecommand(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *)) 335 { 336 unchar direction; 337 unchar *cmd = (unchar *) SCpnt->cmnd; ··· 502 printk(KERN_ALERT "aha1740_queuecommand: done can't be NULL\n"); 503 return 0; 504 } 505 506 /* Query the board for its irq_level and irq_type. Nothing else matters 507 in enhanced mode on an EISA bus. */
··· 331 return IRQ_RETVAL(handled); 332 } 333 334 + static int aha1740_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *)) 335 { 336 unchar direction; 337 unchar *cmd = (unchar *) SCpnt->cmnd; ··· 502 printk(KERN_ALERT "aha1740_queuecommand: done can't be NULL\n"); 503 return 0; 504 } 505 + 506 + static DEF_SCSI_QCMD(aha1740_queuecommand) 507 508 /* Query the board for its irq_level and irq_type. Nothing else matters 509 in enhanced mode on an EISA bus. */
+3 -1
drivers/scsi/aic7xxx/aic79xx_osm.c
··· 573 * Queue an SCB to the controller. 574 */ 575 static int 576 - ahd_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) 577 { 578 struct ahd_softc *ahd; 579 struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device); ··· 587 588 return rtn; 589 } 590 591 static struct scsi_target ** 592 ahd_linux_target_in_softc(struct scsi_target *starget)
··· 573 * Queue an SCB to the controller. 574 */ 575 static int 576 + ahd_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) 577 { 578 struct ahd_softc *ahd; 579 struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device); ··· 587 588 return rtn; 589 } 590 + 591 + static DEF_SCSI_QCMD(ahd_linux_queue) 592 593 static struct scsi_target ** 594 ahd_linux_target_in_softc(struct scsi_target *starget)
+3 -1
drivers/scsi/aic7xxx/aic7xxx_osm.c
··· 528 * Queue an SCB to the controller. 529 */ 530 static int 531 - ahc_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) 532 { 533 struct ahc_softc *ahc; 534 struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device); ··· 547 548 return rtn; 549 } 550 551 static inline struct scsi_target ** 552 ahc_linux_target_in_softc(struct scsi_target *starget)
··· 528 * Queue an SCB to the controller. 529 */ 530 static int 531 + ahc_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) 532 { 533 struct ahc_softc *ahc; 534 struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device); ··· 547 548 return rtn; 549 } 550 + 551 + static DEF_SCSI_QCMD(ahc_linux_queue) 552 553 static inline struct scsi_target ** 554 ahc_linux_target_in_softc(struct scsi_target *starget)
+3 -1
drivers/scsi/aic7xxx_old.c
··· 10234 * Description: 10235 * Queue a SCB to the controller. 10236 *-F*************************************************************************/ 10237 - static int aic7xxx_queue(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) 10238 { 10239 struct aic7xxx_host *p; 10240 struct aic7xxx_scb *scb; ··· 10291 aic7xxx_run_waiting_queues(p); 10292 return (0); 10293 } 10294 10295 /*+F************************************************************************* 10296 * Function:
··· 10234 * Description: 10235 * Queue a SCB to the controller. 10236 *-F*************************************************************************/ 10237 + static int aic7xxx_queue_lck(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) 10238 { 10239 struct aic7xxx_host *p; 10240 struct aic7xxx_scb *scb; ··· 10291 aic7xxx_run_waiting_queues(p); 10292 return (0); 10293 } 10294 + 10295 + static DEF_SCSI_QCMD(aic7xxx_queue) 10296 10297 /*+F************************************************************************* 10298 * Function:
+4 -3
drivers/scsi/arcmsr/arcmsr_hba.c
··· 85 static int arcmsr_bus_reset(struct scsi_cmnd *); 86 static int arcmsr_bios_param(struct scsi_device *sdev, 87 struct block_device *bdev, sector_t capacity, int *info); 88 - static int arcmsr_queue_command(struct scsi_cmnd *cmd, 89 - void (*done) (struct scsi_cmnd *)); 90 static int arcmsr_probe(struct pci_dev *pdev, 91 const struct pci_device_id *id); 92 static void arcmsr_remove(struct pci_dev *pdev); ··· 2080 } 2081 } 2082 2083 - static int arcmsr_queue_command(struct scsi_cmnd *cmd, 2084 void (* done)(struct scsi_cmnd *)) 2085 { 2086 struct Scsi_Host *host = cmd->device->host; ··· 2122 arcmsr_post_ccb(acb, ccb); 2123 return 0; 2124 } 2125 2126 static bool arcmsr_get_hba_config(struct AdapterControlBlock *acb) 2127 {
··· 85 static int arcmsr_bus_reset(struct scsi_cmnd *); 86 static int arcmsr_bios_param(struct scsi_device *sdev, 87 struct block_device *bdev, sector_t capacity, int *info); 88 + static int arcmsr_queue_command(struct Scsi_Host *h, struct scsi_cmnd *cmd); 89 static int arcmsr_probe(struct pci_dev *pdev, 90 const struct pci_device_id *id); 91 static void arcmsr_remove(struct pci_dev *pdev); ··· 2081 } 2082 } 2083 2084 + static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd, 2085 void (* done)(struct scsi_cmnd *)) 2086 { 2087 struct Scsi_Host *host = cmd->device->host; ··· 2123 arcmsr_post_ccb(acb, ccb); 2124 return 0; 2125 } 2126 + 2127 + static DEF_SCSI_QCMD(arcmsr_queue_command) 2128 2129 static bool arcmsr_get_hba_config(struct AdapterControlBlock *acb) 2130 {
+3 -1
drivers/scsi/arm/acornscsi.c
··· 2511 * done - function called on completion, with pointer to command descriptor 2512 * Returns : 0, or < 0 on error. 2513 */ 2514 - int acornscsi_queuecmd(struct scsi_cmnd *SCpnt, 2515 void (*done)(struct scsi_cmnd *)) 2516 { 2517 AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; ··· 2560 } 2561 return 0; 2562 } 2563 2564 /* 2565 * Prototype: void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1, struct scsi_cmnd **SCpntp2, int result)
··· 2511 * done - function called on completion, with pointer to command descriptor 2512 * Returns : 0, or < 0 on error. 2513 */ 2514 + static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt, 2515 void (*done)(struct scsi_cmnd *)) 2516 { 2517 AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; ··· 2560 } 2561 return 0; 2562 } 2563 + 2564 + DEF_SCSI_QCMD(acornscsi_queuecmd) 2565 2566 /* 2567 * Prototype: void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1, struct scsi_cmnd **SCpntp2, int result)
+7 -3
drivers/scsi/arm/fas216.c
··· 2198 * Returns: 0 on success, else error. 2199 * Notes: io_request_lock is held, interrupts are disabled. 2200 */ 2201 - int fas216_queue_command(struct scsi_cmnd *SCpnt, 2202 void (*done)(struct scsi_cmnd *)) 2203 { 2204 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; ··· 2240 return result; 2241 } 2242 2243 /** 2244 * fas216_internal_done - trigger restart of a waiting thread in fas216_noqueue_command 2245 * @SCpnt: Command to wake ··· 2265 * Returns: scsi result code. 2266 * Notes: io_request_lock is held, interrupts are disabled. 2267 */ 2268 - int fas216_noqueue_command(struct scsi_cmnd *SCpnt, 2269 void (*done)(struct scsi_cmnd *)) 2270 { 2271 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; ··· 2279 BUG_ON(info->scsi.irq != NO_IRQ); 2280 2281 info->internal_done = 0; 2282 - fas216_queue_command(SCpnt, fas216_internal_done); 2283 2284 /* 2285 * This wastes time, since we can't return until the command is ··· 2311 2312 return 0; 2313 } 2314 2315 /* 2316 * Error handler timeout function. Indicate that we timed out,
··· 2198 * Returns: 0 on success, else error. 2199 * Notes: io_request_lock is held, interrupts are disabled. 2200 */ 2201 + static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt, 2202 void (*done)(struct scsi_cmnd *)) 2203 { 2204 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; ··· 2240 return result; 2241 } 2242 2243 + DEF_SCSI_QCMD(fas216_queue_command) 2244 + 2245 /** 2246 * fas216_internal_done - trigger restart of a waiting thread in fas216_noqueue_command 2247 * @SCpnt: Command to wake ··· 2263 * Returns: scsi result code. 2264 * Notes: io_request_lock is held, interrupts are disabled. 2265 */ 2266 + static int fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt, 2267 void (*done)(struct scsi_cmnd *)) 2268 { 2269 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; ··· 2277 BUG_ON(info->scsi.irq != NO_IRQ); 2278 2279 info->internal_done = 0; 2280 + fas216_queue_command_lck(SCpnt, fas216_internal_done); 2281 2282 /* 2283 * This wastes time, since we can't return until the command is ··· 2309 2310 return 0; 2311 } 2312 + 2313 + DEF_SCSI_QCMD(fas216_noqueue_command) 2314 2315 /* 2316 * Error handler timeout function. Indicate that we timed out,
+8 -10
drivers/scsi/arm/fas216.h
··· 331 */ 332 extern int fas216_add (struct Scsi_Host *instance, struct device *dev); 333 334 - /* Function: int fas216_queue_command(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 335 * Purpose : queue a command for adapter to process. 336 - * Params : SCpnt - Command to queue 337 - * done - done function to call once command is complete 338 * Returns : 0 - success, else error 339 */ 340 - extern int fas216_queue_command(struct scsi_cmnd *, 341 - void (*done)(struct scsi_cmnd *)); 342 343 - /* Function: int fas216_noqueue_command(istruct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 344 * Purpose : queue a command for adapter to process, and process it to completion. 345 - * Params : SCpnt - Command to queue 346 - * done - done function to call once command is complete 347 * Returns : 0 - success, else error 348 */ 349 - extern int fas216_noqueue_command(struct scsi_cmnd *, 350 - void (*done)(struct scsi_cmnd *)); 351 352 /* Function: irqreturn_t fas216_intr (FAS216_Info *info) 353 * Purpose : handle interrupts from the interface to progress a command
··· 331 */ 332 extern int fas216_add (struct Scsi_Host *instance, struct device *dev); 333 334 + /* Function: int fas216_queue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt) 335 * Purpose : queue a command for adapter to process. 336 + * Params : h - host adapter 337 + * : SCpnt - Command to queue 338 * Returns : 0 - success, else error 339 */ 340 + extern int fas216_queue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt); 341 342 + /* Function: int fas216_noqueue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt) 343 * Purpose : queue a command for adapter to process, and process it to completion. 344 + * Params : h - host adapter 345 + * : SCpnt - Command to queue 346 * Returns : 0 - success, else error 347 */ 348 + extern int fas216_noqueue_command(struct Scsi_Host *, struct scsi_cmnd *) 349 350 /* Function: irqreturn_t fas216_intr (FAS216_Info *info) 351 * Purpose : handle interrupts from the interface to progress a command
+3 -1
drivers/scsi/atari_NCR5380.c
··· 910 * 911 */ 912 913 - static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) 914 { 915 SETUP_HOSTDATA(cmd->device->host); 916 Scsi_Cmnd *tmp; ··· 1021 NCR5380_main(NULL); 1022 return 0; 1023 } 1024 1025 /* 1026 * Function : NCR5380_main (void)
··· 910 * 911 */ 912 913 + static int NCR5380_queue_command_lck(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) 914 { 915 SETUP_HOSTDATA(cmd->device->host); 916 Scsi_Cmnd *tmp; ··· 1021 NCR5380_main(NULL); 1022 return 0; 1023 } 1024 + 1025 + static DEF_SCSI_QCMD(NCR5380_queue_command) 1026 1027 /* 1028 * Function : NCR5380_main (void)
-17
drivers/scsi/atari_scsi.c
··· 572 } 573 574 575 - /* This is the wrapper function for NCR5380_queue_command(). It just 576 - * tries to get the lock on the ST-DMA (see above) and then calls the 577 - * original function. 578 - */ 579 - 580 - #if 0 581 - int atari_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) 582 - { 583 - /* falcon_get_lock(); 584 - * ++guenther: moved to NCR5380_queue_command() to prevent 585 - * race condition, see there for an explanation. 586 - */ 587 - return NCR5380_queue_command(cmd, done); 588 - } 589 - #endif 590 - 591 - 592 int __init atari_scsi_detect(struct scsi_host_template *host) 593 { 594 static int called = 0;
··· 572 } 573 574 575 int __init atari_scsi_detect(struct scsi_host_template *host) 576 { 577 static int called = 0;
+3 -1
drivers/scsi/atp870u.c
··· 605 * 606 * Queue a command to the ATP queue. Called with the host lock held. 607 */ 608 - static int atp870u_queuecommand(struct scsi_cmnd * req_p, 609 void (*done) (struct scsi_cmnd *)) 610 { 611 unsigned char c; ··· 693 #endif 694 return 0; 695 } 696 697 /** 698 * send_s870 - send a command to the controller
··· 605 * 606 * Queue a command to the ATP queue. Called with the host lock held. 607 */ 608 + static int atp870u_queuecommand_lck(struct scsi_cmnd *req_p, 609 void (*done) (struct scsi_cmnd *)) 610 { 611 unsigned char c; ··· 693 #endif 694 return 0; 695 } 696 + 697 + static DEF_SCSI_QCMD(atp870u_queuecommand) 698 699 /** 700 * send_s870 - send a command to the controller
+4 -3
drivers/scsi/bfa/bfad_im.c
··· 30 struct scsi_transport_template *bfad_im_scsi_transport_template; 31 struct scsi_transport_template *bfad_im_scsi_vport_transport_template; 32 static void bfad_im_itnim_work_handler(struct work_struct *work); 33 - static int bfad_im_queuecommand(struct scsi_cmnd *cmnd, 34 - void (*done)(struct scsi_cmnd *)); 35 static int bfad_im_slave_alloc(struct scsi_device *sdev); 36 static void bfad_im_fc_rport_add(struct bfad_im_port_s *im_port, 37 struct bfad_itnim_s *itnim); ··· 1119 * Scsi_Host template entry, queue a SCSI command to the BFAD. 1120 */ 1121 static int 1122 - bfad_im_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) 1123 { 1124 struct bfad_im_port_s *im_port = 1125 (struct bfad_im_port_s *) cmnd->device->host->hostdata[0]; ··· 1185 1186 return 0; 1187 } 1188 1189 void 1190 bfad_os_rport_online_wait(struct bfad_s *bfad)
··· 30 struct scsi_transport_template *bfad_im_scsi_transport_template; 31 struct scsi_transport_template *bfad_im_scsi_vport_transport_template; 32 static void bfad_im_itnim_work_handler(struct work_struct *work); 33 + static int bfad_im_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmnd); 34 static int bfad_im_slave_alloc(struct scsi_device *sdev); 35 static void bfad_im_fc_rport_add(struct bfad_im_port_s *im_port, 36 struct bfad_itnim_s *itnim); ··· 1120 * Scsi_Host template entry, queue a SCSI command to the BFAD. 1121 */ 1122 static int 1123 + bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) 1124 { 1125 struct bfad_im_port_s *im_port = 1126 (struct bfad_im_port_s *) cmnd->device->host->hostdata[0]; ··· 1186 1187 return 0; 1188 } 1189 + 1190 + static DEF_SCSI_QCMD(bfad_im_queuecommand) 1191 1192 void 1193 bfad_os_rport_online_wait(struct bfad_s *bfad)
+2 -1
drivers/scsi/dc395x.c
··· 1080 * and is expected to be held on return. 1081 * 1082 **/ 1083 - static int dc395x_queue_command(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 1084 { 1085 struct DeviceCtlBlk *dcb; 1086 struct ScsiReqBlk *srb; ··· 1154 return 0; 1155 } 1156 1157 1158 /* 1159 * Return the disk geometry for the given SCSI device.
··· 1080 * and is expected to be held on return. 1081 * 1082 **/ 1083 + static int dc395x_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 1084 { 1085 struct DeviceCtlBlk *dcb; 1086 struct ScsiReqBlk *srb; ··· 1154 return 0; 1155 } 1156 1157 + static DEF_SCSI_QCMD(dc395x_queue_command) 1158 1159 /* 1160 * Return the disk geometry for the given SCSI device.
+3 -1
drivers/scsi/dpt_i2o.c
··· 423 return 0; 424 } 425 426 - static int adpt_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) 427 { 428 adpt_hba* pHba = NULL; 429 struct adpt_device* pDev = NULL; /* dpt per device information */ ··· 490 } 491 return adpt_scsi_to_i2o(pHba, cmd, pDev); 492 } 493 494 static int adpt_bios_param(struct scsi_device *sdev, struct block_device *dev, 495 sector_t capacity, int geom[])
··· 423 return 0; 424 } 425 426 + static int adpt_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) 427 { 428 adpt_hba* pHba = NULL; 429 struct adpt_device* pDev = NULL; /* dpt per device information */ ··· 490 } 491 return adpt_scsi_to_i2o(pHba, cmd, pDev); 492 } 493 + 494 + static DEF_SCSI_QCMD(adpt_queue) 495 496 static int adpt_bios_param(struct scsi_device *sdev, struct block_device *dev, 497 sector_t capacity, int geom[])
+1 -1
drivers/scsi/dpti.h
··· 29 */ 30 31 static int adpt_detect(struct scsi_host_template * sht); 32 - static int adpt_queue(struct scsi_cmnd * cmd, void (*cmdcomplete) (struct scsi_cmnd *)); 33 static int adpt_abort(struct scsi_cmnd * cmd); 34 static int adpt_reset(struct scsi_cmnd* cmd); 35 static int adpt_release(struct Scsi_Host *host);
··· 29 */ 30 31 static int adpt_detect(struct scsi_host_template * sht); 32 + static int adpt_queue(struct Scsi_Host *h, struct scsi_cmnd * cmd); 33 static int adpt_abort(struct scsi_cmnd * cmd); 34 static int adpt_reset(struct scsi_cmnd* cmd); 35 static int adpt_release(struct Scsi_Host *host);
+1 -1
drivers/scsi/dtc.h
··· 36 static int dtc_biosparam(struct scsi_device *, struct block_device *, 37 sector_t, int*); 38 static int dtc_detect(struct scsi_host_template *); 39 - static int dtc_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 40 static int dtc_bus_reset(Scsi_Cmnd *); 41 42 #ifndef CMD_PER_LUN
··· 36 static int dtc_biosparam(struct scsi_device *, struct block_device *, 37 sector_t, int*); 38 static int dtc_detect(struct scsi_host_template *); 39 + static int dtc_queue_command(struct Scsi_Host *, struct scsi_cmnd *); 40 static int dtc_bus_reset(Scsi_Cmnd *); 41 42 #ifndef CMD_PER_LUN
+4 -3
drivers/scsi/eata.c
··· 505 506 static int eata2x_detect(struct scsi_host_template *); 507 static int eata2x_release(struct Scsi_Host *); 508 - static int eata2x_queuecommand(struct scsi_cmnd *, 509 - void (*done) (struct scsi_cmnd *)); 510 static int eata2x_eh_abort(struct scsi_cmnd *); 511 static int eata2x_eh_host_reset(struct scsi_cmnd *); 512 static int eata2x_bios_param(struct scsi_device *, struct block_device *, ··· 1757 1758 } 1759 1760 - static int eata2x_queuecommand(struct scsi_cmnd *SCpnt, 1761 void (*done) (struct scsi_cmnd *)) 1762 { 1763 struct Scsi_Host *shost = SCpnt->device->host; ··· 1841 ha->cp_stat[i] = IN_USE; 1842 return 0; 1843 } 1844 1845 static int eata2x_eh_abort(struct scsi_cmnd *SCarg) 1846 {
··· 505 506 static int eata2x_detect(struct scsi_host_template *); 507 static int eata2x_release(struct Scsi_Host *); 508 + static int eata2x_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 509 static int eata2x_eh_abort(struct scsi_cmnd *); 510 static int eata2x_eh_host_reset(struct scsi_cmnd *); 511 static int eata2x_bios_param(struct scsi_device *, struct block_device *, ··· 1758 1759 } 1760 1761 + static int eata2x_queuecommand_lck(struct scsi_cmnd *SCpnt, 1762 void (*done) (struct scsi_cmnd *)) 1763 { 1764 struct Scsi_Host *shost = SCpnt->device->host; ··· 1842 ha->cp_stat[i] = IN_USE; 1843 return 0; 1844 } 1845 + 1846 + static DEF_SCSI_QCMD(eata2x_queuecommand) 1847 1848 static int eata2x_eh_abort(struct scsi_cmnd *SCarg) 1849 {
+3 -1
drivers/scsi/eata_pio.c
··· 335 return 0; 336 } 337 338 - static int eata_pio_queue(struct scsi_cmnd *cmd, 339 void (*done)(struct scsi_cmnd *)) 340 { 341 unsigned int x, y; ··· 437 438 return 0; 439 } 440 441 static int eata_pio_abort(struct scsi_cmnd *cmd) 442 {
··· 335 return 0; 336 } 337 338 + static int eata_pio_queue_lck(struct scsi_cmnd *cmd, 339 void (*done)(struct scsi_cmnd *)) 340 { 341 unsigned int x, y; ··· 437 438 return 0; 439 } 440 + 441 + static DEF_SCSI_QCMD(eata_pio_queue) 442 443 static int eata_pio_abort(struct scsi_cmnd *cmd) 444 {
+3 -1
drivers/scsi/esp_scsi.c
··· 916 scsi_track_queue_full(dev, lp->num_tagged - 1); 917 } 918 919 - static int esp_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 920 { 921 struct scsi_device *dev = cmd->device; 922 struct esp *esp = shost_priv(dev->host); ··· 940 941 return 0; 942 } 943 944 static int esp_check_gross_error(struct esp *esp) 945 {
··· 916 scsi_track_queue_full(dev, lp->num_tagged - 1); 917 } 918 919 + static int esp_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 920 { 921 struct scsi_device *dev = cmd->device; 922 struct esp *esp = shost_priv(dev->host); ··· 940 941 return 0; 942 } 943 + 944 + static DEF_SCSI_QCMD(esp_queuecommand) 945 946 static int esp_check_gross_error(struct esp *esp) 947 {
+3 -1
drivers/scsi/fd_mcs.c
··· 1072 return 0; 1073 } 1074 1075 - static int fd_mcs_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) 1076 { 1077 struct Scsi_Host *shpnt = SCpnt->device->host; 1078 ··· 1121 1122 return 0; 1123 } 1124 1125 #if DEBUG_ABORT || DEBUG_RESET 1126 static void fd_mcs_print_info(Scsi_Cmnd * SCpnt)
··· 1072 return 0; 1073 } 1074 1075 + static int fd_mcs_queue_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) 1076 { 1077 struct Scsi_Host *shpnt = SCpnt->device->host; 1078 ··· 1121 1122 return 0; 1123 } 1124 + 1125 + static DEF_SCSI_QCMD(fd_mcs_queue) 1126 1127 #if DEBUG_ABORT || DEBUG_RESET 1128 static void fd_mcs_print_info(Scsi_Cmnd * SCpnt)
+3 -1
drivers/scsi/fdomain.c
··· 1419 return IRQ_HANDLED; 1420 } 1421 1422 - static int fdomain_16x0_queue(struct scsi_cmnd *SCpnt, 1423 void (*done)(struct scsi_cmnd *)) 1424 { 1425 if (in_command) { ··· 1468 1469 return 0; 1470 } 1471 1472 #if DEBUG_ABORT 1473 static void print_info(struct scsi_cmnd *SCpnt)
··· 1419 return IRQ_HANDLED; 1420 } 1421 1422 + static int fdomain_16x0_queue_lck(struct scsi_cmnd *SCpnt, 1423 void (*done)(struct scsi_cmnd *)) 1424 { 1425 if (in_command) { ··· 1468 1469 return 0; 1470 } 1471 + 1472 + static DEF_SCSI_QCMD(fdomain_16x0_queue) 1473 1474 #if DEBUG_ABORT 1475 static void print_info(struct scsi_cmnd *SCpnt)
+1 -1
drivers/scsi/fnic/fnic.h
··· 246 void fnic_update_mac(struct fc_lport *, u8 *new); 247 void fnic_update_mac_locked(struct fnic *, u8 *new); 248 249 - int fnic_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); 250 int fnic_abort_cmd(struct scsi_cmnd *); 251 int fnic_device_reset(struct scsi_cmnd *); 252 int fnic_host_reset(struct scsi_cmnd *);
··· 246 void fnic_update_mac(struct fc_lport *, u8 *new); 247 void fnic_update_mac_locked(struct fnic *, u8 *new); 248 249 + int fnic_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 250 int fnic_abort_cmd(struct scsi_cmnd *); 251 int fnic_device_reset(struct scsi_cmnd *); 252 int fnic_host_reset(struct scsi_cmnd *);
+3 -1
drivers/scsi/fnic/fnic_scsi.c
··· 349 * Routine to send a scsi cdb 350 * Called with host_lock held and interrupts disabled. 351 */ 352 - int fnic_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) 353 { 354 struct fc_lport *lp; 355 struct fc_rport *rport; ··· 456 spin_lock(lp->host->host_lock); 457 return ret; 458 } 459 460 /* 461 * fnic_fcpio_fw_reset_cmpl_handler
··· 349 * Routine to send a scsi cdb 350 * Called with host_lock held and interrupts disabled. 351 */ 352 + static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) 353 { 354 struct fc_lport *lp; 355 struct fc_rport *rport; ··· 456 spin_lock(lp->host->host_lock); 457 return ret; 458 } 459 + 460 + DEF_SCSI_QCMD(fnic_queuecommand) 461 462 /* 463 * fnic_fcpio_fw_reset_cmpl_handler
+1 -1
drivers/scsi/g_NCR5380.h
··· 46 static int generic_NCR5380_abort(Scsi_Cmnd *); 47 static int generic_NCR5380_detect(struct scsi_host_template *); 48 static int generic_NCR5380_release_resources(struct Scsi_Host *); 49 - static int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 50 static int generic_NCR5380_bus_reset(Scsi_Cmnd *); 51 static const char* generic_NCR5380_info(struct Scsi_Host *); 52
··· 46 static int generic_NCR5380_abort(Scsi_Cmnd *); 47 static int generic_NCR5380_detect(struct scsi_host_template *); 48 static int generic_NCR5380_release_resources(struct Scsi_Host *); 49 + static int generic_NCR5380_queue_command(struct Scsi_Host *, struct scsi_cmnd *); 50 static int generic_NCR5380_bus_reset(Scsi_Cmnd *); 51 static const char* generic_NCR5380_info(struct Scsi_Host *); 52
+4 -2
drivers/scsi/gdth.c
··· 185 unsigned long arg); 186 187 static void gdth_flush(gdth_ha_str *ha); 188 - static int gdth_queuecommand(Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *)); 189 static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp, 190 struct gdth_cmndinfo *cmndinfo); 191 static void gdth_scsi_done(struct scsi_cmnd *scp); ··· 4004 } 4005 4006 4007 - static int gdth_queuecommand(struct scsi_cmnd *scp, 4008 void (*done)(struct scsi_cmnd *)) 4009 { 4010 gdth_ha_str *ha = shost_priv(scp->device->host); ··· 4021 4022 return __gdth_queuecommand(ha, scp, cmndinfo); 4023 } 4024 4025 static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp, 4026 struct gdth_cmndinfo *cmndinfo)
··· 185 unsigned long arg); 186 187 static void gdth_flush(gdth_ha_str *ha); 188 + static int gdth_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmd); 189 static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp, 190 struct gdth_cmndinfo *cmndinfo); 191 static void gdth_scsi_done(struct scsi_cmnd *scp); ··· 4004 } 4005 4006 4007 + static int gdth_queuecommand_lck(struct scsi_cmnd *scp, 4008 void (*done)(struct scsi_cmnd *)) 4009 { 4010 gdth_ha_str *ha = shost_priv(scp->device->host); ··· 4021 4022 return __gdth_queuecommand(ha, scp, cmndinfo); 4023 } 4024 + 4025 + static DEF_SCSI_QCMD(gdth_queuecommand) 4026 4027 static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp, 4028 struct gdth_cmndinfo *cmndinfo)
+4 -3
drivers/scsi/hpsa.c
··· 143 void *buff, size_t size, u8 page_code, unsigned char *scsi3addr, 144 int cmd_type); 145 146 - static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd, 147 - void (*done)(struct scsi_cmnd *)); 148 static void hpsa_scan_start(struct Scsi_Host *); 149 static int hpsa_scan_finished(struct Scsi_Host *sh, 150 unsigned long elapsed_time); ··· 1925 } 1926 1927 1928 - static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd, 1929 void (*done)(struct scsi_cmnd *)) 1930 { 1931 struct ctlr_info *h; ··· 2018 /* the cmd'll come back via intr handler in complete_scsi_command() */ 2019 return 0; 2020 } 2021 2022 static void hpsa_scan_start(struct Scsi_Host *sh) 2023 {
··· 143 void *buff, size_t size, u8 page_code, unsigned char *scsi3addr, 144 int cmd_type); 145 146 + static int hpsa_scsi_queue_command(struct Scsi_Host *h, struct scsi_cmnd *cmd); 147 static void hpsa_scan_start(struct Scsi_Host *); 148 static int hpsa_scan_finished(struct Scsi_Host *sh, 149 unsigned long elapsed_time); ··· 1926 } 1927 1928 1929 + static int hpsa_scsi_queue_command_lck(struct scsi_cmnd *cmd, 1930 void (*done)(struct scsi_cmnd *)) 1931 { 1932 struct ctlr_info *h; ··· 2019 /* the cmd'll come back via intr handler in complete_scsi_command() */ 2020 return 0; 2021 } 2022 + 2023 + static DEF_SCSI_QCMD(hpsa_scsi_queue_command) 2024 2025 static void hpsa_scan_start(struct Scsi_Host *sh) 2026 {
+3 -1
drivers/scsi/hptiop.c
··· 751 MVIOP_MU_QUEUE_ADDR_HOST_BIT | size_bit, hba); 752 } 753 754 - static int hptiop_queuecommand(struct scsi_cmnd *scp, 755 void (*done)(struct scsi_cmnd *)) 756 { 757 struct Scsi_Host *host = scp->device->host; ··· 818 scp->scsi_done(scp); 819 return 0; 820 } 821 822 static const char *hptiop_info(struct Scsi_Host *host) 823 {
··· 751 MVIOP_MU_QUEUE_ADDR_HOST_BIT | size_bit, hba); 752 } 753 754 + static int hptiop_queuecommand_lck(struct scsi_cmnd *scp, 755 void (*done)(struct scsi_cmnd *)) 756 { 757 struct Scsi_Host *host = scp->device->host; ··· 818 scp->scsi_done(scp); 819 return 0; 820 } 821 + 822 + static DEF_SCSI_QCMD(hptiop_queuecommand) 823 824 static const char *hptiop_info(struct Scsi_Host *host) 825 {
+4 -2
drivers/scsi/ibmmca.c
··· 39 #include <scsi/scsi_host.h> 40 41 /* Common forward declarations for all Linux-versions: */ 42 - static int ibmmca_queuecommand (Scsi_Cmnd *, void (*done) (Scsi_Cmnd *)); 43 static int ibmmca_abort (Scsi_Cmnd *); 44 static int ibmmca_host_reset (Scsi_Cmnd *); 45 static int ibmmca_biosparam (struct scsi_device *, struct block_device *, sector_t, int *); ··· 1691 } 1692 1693 /* The following routine is the SCSI command queue for the midlevel driver */ 1694 - static int ibmmca_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) 1695 { 1696 unsigned int ldn; 1697 unsigned int scsi_cmd; ··· 1995 } 1996 return 0; 1997 } 1998 1999 static int __ibmmca_abort(Scsi_Cmnd * cmd) 2000 {
··· 39 #include <scsi/scsi_host.h> 40 41 /* Common forward declarations for all Linux-versions: */ 42 + static int ibmmca_queuecommand (struct Scsi_Host *, struct scsi_cmnd *); 43 static int ibmmca_abort (Scsi_Cmnd *); 44 static int ibmmca_host_reset (Scsi_Cmnd *); 45 static int ibmmca_biosparam (struct scsi_device *, struct block_device *, sector_t, int *); ··· 1691 } 1692 1693 /* The following routine is the SCSI command queue for the midlevel driver */ 1694 + static int ibmmca_queuecommand_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) 1695 { 1696 unsigned int ldn; 1697 unsigned int scsi_cmd; ··· 1995 } 1996 return 0; 1997 } 1998 + 1999 + static DEF_SCSI_QCMD(ibmmca_queuecommand) 2000 2001 static int __ibmmca_abort(Scsi_Cmnd * cmd) 2002 {
+3 -1
drivers/scsi/ibmvscsi/ibmvfc.c
··· 1606 * Returns: 1607 * 0 on success / other on failure 1608 **/ 1609 - static int ibmvfc_queuecommand(struct scsi_cmnd *cmnd, 1610 void (*done) (struct scsi_cmnd *)) 1611 { 1612 struct ibmvfc_host *vhost = shost_priv(cmnd->device->host); ··· 1671 done(cmnd); 1672 return 0; 1673 } 1674 1675 /** 1676 * ibmvfc_sync_completion - Signal that a synchronous command has completed
··· 1606 * Returns: 1607 * 0 on success / other on failure 1608 **/ 1609 + static int ibmvfc_queuecommand_lck(struct scsi_cmnd *cmnd, 1610 void (*done) (struct scsi_cmnd *)) 1611 { 1612 struct ibmvfc_host *vhost = shost_priv(cmnd->device->host); ··· 1671 done(cmnd); 1672 return 0; 1673 } 1674 + 1675 + static DEF_SCSI_QCMD(ibmvfc_queuecommand) 1676 1677 /** 1678 * ibmvfc_sync_completion - Signal that a synchronous command has completed
+3 -1
drivers/scsi/ibmvscsi/ibmvscsi.c
··· 713 * @cmd: struct scsi_cmnd to be executed 714 * @done: Callback function to be called when cmd is completed 715 */ 716 - static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd, 717 void (*done) (struct scsi_cmnd *)) 718 { 719 struct srp_cmd *srp_cmd; ··· 765 766 return ibmvscsi_send_srp_event(evt_struct, hostdata, 0); 767 } 768 769 /* ------------------------------------------------------------ 770 * Routines for driver initialization
··· 713 * @cmd: struct scsi_cmnd to be executed 714 * @done: Callback function to be called when cmd is completed 715 */ 716 + static int ibmvscsi_queuecommand_lck(struct scsi_cmnd *cmnd, 717 void (*done) (struct scsi_cmnd *)) 718 { 719 struct srp_cmd *srp_cmd; ··· 765 766 return ibmvscsi_send_srp_event(evt_struct, hostdata, 0); 767 } 768 + 769 + static DEF_SCSI_QCMD(ibmvscsi_queuecommand) 770 771 /* ------------------------------------------------------------ 772 * Routines for driver initialization
+3 -1
drivers/scsi/imm.c
··· 926 return 0; 927 } 928 929 - static int imm_queuecommand(struct scsi_cmnd *cmd, 930 void (*done)(struct scsi_cmnd *)) 931 { 932 imm_struct *dev = imm_dev(cmd->device->host); ··· 948 949 return 0; 950 } 951 952 /* 953 * Apparently the disk->capacity attribute is off by 1 sector
··· 926 return 0; 927 } 928 929 + static int imm_queuecommand_lck(struct scsi_cmnd *cmd, 930 void (*done)(struct scsi_cmnd *)) 931 { 932 imm_struct *dev = imm_dev(cmd->device->host); ··· 948 949 return 0; 950 } 951 + 952 + static DEF_SCSI_QCMD(imm_queuecommand) 953 954 /* 955 * Apparently the disk->capacity attribute is off by 1 sector
+3 -1
drivers/scsi/in2000.c
··· 334 335 static void in2000_execute(struct Scsi_Host *instance); 336 337 - static int in2000_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) 338 { 339 struct Scsi_Host *instance; 340 struct IN2000_hostdata *hostdata; ··· 430 DB(DB_QUEUE_COMMAND, printk(")Q-%ld ", cmd->serial_number)) 431 return 0; 432 } 433 434 435
··· 334 335 static void in2000_execute(struct Scsi_Host *instance); 336 337 + static int in2000_queuecommand_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) 338 { 339 struct Scsi_Host *instance; 340 struct IN2000_hostdata *hostdata; ··· 430 DB(DB_QUEUE_COMMAND, printk(")Q-%ld ", cmd->serial_number)) 431 return 0; 432 } 433 + 434 + static DEF_SCSI_QCMD(in2000_queuecommand) 435 436 437
+1 -1
drivers/scsi/in2000.h
··· 396 flags) 397 398 static int in2000_detect(struct scsi_host_template *) in2000__INIT; 399 - static int in2000_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 400 static int in2000_abort(Scsi_Cmnd *); 401 static void in2000_setup(char *, int *) in2000__INIT; 402 static int in2000_biosparam(struct scsi_device *, struct block_device *,
··· 396 flags) 397 398 static int in2000_detect(struct scsi_host_template *) in2000__INIT; 399 + static int in2000_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 400 static int in2000_abort(Scsi_Cmnd *); 401 static void in2000_setup(char *, int *) in2000__INIT; 402 static int in2000_biosparam(struct scsi_device *, struct block_device *,
+3 -1
drivers/scsi/initio.c
··· 2639 * will cause the mid layer to call us again later with the command) 2640 */ 2641 2642 - static int i91u_queuecommand(struct scsi_cmnd *cmd, 2643 void (*done)(struct scsi_cmnd *)) 2644 { 2645 struct initio_host *host = (struct initio_host *) cmd->device->host->hostdata; ··· 2655 initio_exec_scb(host, cmnd); 2656 return 0; 2657 } 2658 2659 /** 2660 * i91u_bus_reset - reset the SCSI bus
··· 2639 * will cause the mid layer to call us again later with the command) 2640 */ 2641 2642 + static int i91u_queuecommand_lck(struct scsi_cmnd *cmd, 2643 void (*done)(struct scsi_cmnd *)) 2644 { 2645 struct initio_host *host = (struct initio_host *) cmd->device->host->hostdata; ··· 2655 initio_exec_scb(host, cmnd); 2656 return 0; 2657 } 2658 + 2659 + static DEF_SCSI_QCMD(i91u_queuecommand) 2660 2661 /** 2662 * i91u_bus_reset - reset the SCSI bus
+3 -1
drivers/scsi/ipr.c
··· 5709 * SCSI_MLQUEUE_DEVICE_BUSY if device is busy 5710 * SCSI_MLQUEUE_HOST_BUSY if host is busy 5711 **/ 5712 - static int ipr_queuecommand(struct scsi_cmnd *scsi_cmd, 5713 void (*done) (struct scsi_cmnd *)) 5714 { 5715 struct ipr_ioa_cfg *ioa_cfg; ··· 5791 5792 return 0; 5793 } 5794 5795 /** 5796 * ipr_ioctl - IOCTL handler
··· 5709 * SCSI_MLQUEUE_DEVICE_BUSY if device is busy 5710 * SCSI_MLQUEUE_HOST_BUSY if host is busy 5711 **/ 5712 + static int ipr_queuecommand_lck(struct scsi_cmnd *scsi_cmd, 5713 void (*done) (struct scsi_cmnd *)) 5714 { 5715 struct ipr_ioa_cfg *ioa_cfg; ··· 5791 5792 return 0; 5793 } 5794 + 5795 + static DEF_SCSI_QCMD(ipr_queuecommand) 5796 5797 /** 5798 * ipr_ioctl - IOCTL handler
+4 -2
drivers/scsi/ips.c
··· 232 static int ips_release(struct Scsi_Host *); 233 static int ips_eh_abort(struct scsi_cmnd *); 234 static int ips_eh_reset(struct scsi_cmnd *); 235 - static int ips_queue(struct scsi_cmnd *, void (*)(struct scsi_cmnd *)); 236 static const char *ips_info(struct Scsi_Host *); 237 static irqreturn_t do_ipsintr(int, void *); 238 static int ips_hainit(ips_ha_t *); ··· 1046 /* Linux obtains io_request_lock before calling this function */ 1047 /* */ 1048 /****************************************************************************/ 1049 - static int ips_queue(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)) 1050 { 1051 ips_ha_t *ha; 1052 ips_passthru_t *pt; ··· 1136 1137 return (0); 1138 } 1139 1140 /****************************************************************************/ 1141 /* */
··· 232 static int ips_release(struct Scsi_Host *); 233 static int ips_eh_abort(struct scsi_cmnd *); 234 static int ips_eh_reset(struct scsi_cmnd *); 235 + static int ips_queue(struct Scsi_Host *, struct scsi_cmnd *); 236 static const char *ips_info(struct Scsi_Host *); 237 static irqreturn_t do_ipsintr(int, void *); 238 static int ips_hainit(ips_ha_t *); ··· 1046 /* Linux obtains io_request_lock before calling this function */ 1047 /* */ 1048 /****************************************************************************/ 1049 + static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)) 1050 { 1051 ips_ha_t *ha; 1052 ips_passthru_t *pt; ··· 1136 1137 return (0); 1138 } 1139 + 1140 + static DEF_SCSI_QCMD(ips_queue) 1141 1142 /****************************************************************************/ 1143 /* */
+3 -1
drivers/scsi/libfc/fc_fcp.c
··· 1753 * This is the i/o strategy routine, called by the SCSI layer. This routine 1754 * is called with the host_lock held. 1755 */ 1756 - int fc_queuecommand(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *)) 1757 { 1758 struct fc_lport *lport; 1759 struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device)); ··· 1851 spin_lock_irq(lport->host->host_lock); 1852 return rc; 1853 } 1854 EXPORT_SYMBOL(fc_queuecommand); 1855 1856 /**
··· 1753 * This is the i/o strategy routine, called by the SCSI layer. This routine 1754 * is called with the host_lock held. 1755 */ 1756 + static int fc_queuecommand_lck(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *)) 1757 { 1758 struct fc_lport *lport; 1759 struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device)); ··· 1851 spin_lock_irq(lport->host->host_lock); 1852 return rc; 1853 } 1854 + 1855 + DEF_SCSI_QCMD(fc_queuecommand) 1856 EXPORT_SYMBOL(fc_queuecommand); 1857 1858 /**
+3 -1
drivers/scsi/libiscsi.c
··· 1599 FAILURE_SESSION_NOT_READY, 1600 }; 1601 1602 - int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) 1603 { 1604 struct iscsi_cls_session *cls_session; 1605 struct Scsi_Host *host; ··· 1736 spin_lock(host->host_lock); 1737 return 0; 1738 } 1739 EXPORT_SYMBOL_GPL(iscsi_queuecommand); 1740 1741 int iscsi_change_queue_depth(struct scsi_device *sdev, int depth, int reason)
··· 1599 FAILURE_SESSION_NOT_READY, 1600 }; 1601 1602 + static int iscsi_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) 1603 { 1604 struct iscsi_cls_session *cls_session; 1605 struct Scsi_Host *host; ··· 1736 spin_lock(host->host_lock); 1737 return 0; 1738 } 1739 + 1740 + DEF_SCSI_QCMD(iscsi_queuecommand) 1741 EXPORT_SYMBOL_GPL(iscsi_queuecommand); 1742 1743 int iscsi_change_queue_depth(struct scsi_device *sdev, int depth, int reason)
+3 -1
drivers/scsi/libsas/sas_scsi_host.c
··· 189 * Note: XXX: Remove the host unlock/lock pair when SCSI Core can 190 * call us without holding an IRQ spinlock... 191 */ 192 - int sas_queuecommand(struct scsi_cmnd *cmd, 193 void (*scsi_done)(struct scsi_cmnd *)) 194 __releases(host->host_lock) 195 __acquires(dev->sata_dev.ap->lock) ··· 253 spin_lock_irq(host->host_lock); 254 return res; 255 } 256 257 static void sas_eh_finish_cmd(struct scsi_cmnd *cmd) 258 {
··· 189 * Note: XXX: Remove the host unlock/lock pair when SCSI Core can 190 * call us without holding an IRQ spinlock... 191 */ 192 + static int sas_queuecommand_lck(struct scsi_cmnd *cmd, 193 void (*scsi_done)(struct scsi_cmnd *)) 194 __releases(host->host_lock) 195 __acquires(dev->sata_dev.ap->lock) ··· 253 spin_lock_irq(host->host_lock); 254 return res; 255 } 256 + 257 + DEF_SCSI_QCMD(sas_queuecommand) 258 259 static void sas_eh_finish_cmd(struct scsi_cmnd *cmd) 260 {
+3 -1
drivers/scsi/lpfc/lpfc_scsi.c
··· 2899 * SCSI_MLQUEUE_HOST_BUSY - Block all devices served by this host temporarily. 2900 **/ 2901 static int 2902 - lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) 2903 { 2904 struct Scsi_Host *shost = cmnd->device->host; 2905 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; ··· 3059 done(cmnd); 3060 return 0; 3061 } 3062 3063 /** 3064 * lpfc_abort_handler - scsi_host_template eh_abort_handler entry point
··· 2899 * SCSI_MLQUEUE_HOST_BUSY - Block all devices served by this host temporarily. 2900 **/ 2901 static int 2902 + lpfc_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) 2903 { 2904 struct Scsi_Host *shost = cmnd->device->host; 2905 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; ··· 3059 done(cmnd); 3060 return 0; 3061 } 3062 + 3063 + static DEF_SCSI_QCMD(lpfc_queuecommand) 3064 3065 /** 3066 * lpfc_abort_handler - scsi_host_template eh_abort_handler entry point
+3 -1
drivers/scsi/mac53c94.c
··· 66 static void set_dma_cmds(struct fsc_state *, struct scsi_cmnd *); 67 68 69 - static int mac53c94_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 70 { 71 struct fsc_state *state; 72 ··· 98 99 return 0; 100 } 101 102 static int mac53c94_host_reset(struct scsi_cmnd *cmd) 103 {
··· 66 static void set_dma_cmds(struct fsc_state *, struct scsi_cmnd *); 67 68 69 + static int mac53c94_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 70 { 71 struct fsc_state *state; 72 ··· 98 99 return 0; 100 } 101 + 102 + static DEF_SCSI_QCMD(mac53c94_queue) 103 104 static int mac53c94_host_reset(struct scsi_cmnd *cmd) 105 {
+4 -2
drivers/scsi/megaraid.c
··· 366 * The command queuing entry point for the mid-layer. 367 */ 368 static int 369 - megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *)) 370 { 371 adapter_t *adapter; 372 scb_t *scb; ··· 408 spin_unlock_irqrestore(&adapter->lock, flags); 409 return busy; 410 } 411 412 /** 413 * mega_allocate_scb() ··· 4458 4459 scb->idx = CMDID_INT_CMDS; 4460 4461 - megaraid_queue(scmd, mega_internal_done); 4462 4463 wait_for_completion(&adapter->int_waitq); 4464
··· 366 * The command queuing entry point for the mid-layer. 367 */ 368 static int 369 + megaraid_queue_lck(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *)) 370 { 371 adapter_t *adapter; 372 scb_t *scb; ··· 408 spin_unlock_irqrestore(&adapter->lock, flags); 409 return busy; 410 } 411 + 412 + static DEF_SCSI_QCMD(megaraid_queue) 413 414 /** 415 * mega_allocate_scb() ··· 4456 4457 scb->idx = CMDID_INT_CMDS; 4458 4459 + megaraid_queue_lck(scmd, mega_internal_done); 4460 4461 wait_for_completion(&adapter->int_waitq); 4462
+1 -1
drivers/scsi/megaraid.h
··· 987 static int issue_scb(adapter_t *, scb_t *); 988 static int mega_setup_mailbox(adapter_t *); 989 990 - static int megaraid_queue (Scsi_Cmnd *, void (*)(Scsi_Cmnd *)); 991 static scb_t * mega_build_cmd(adapter_t *, Scsi_Cmnd *, int *); 992 static void __mega_runpendq(adapter_t *); 993 static int issue_scb_block(adapter_t *, u_char *);
··· 987 static int issue_scb(adapter_t *, scb_t *); 988 static int mega_setup_mailbox(adapter_t *); 989 990 + static int megaraid_queue (struct Scsi_Host *, struct scsi_cmnd *); 991 static scb_t * mega_build_cmd(adapter_t *, Scsi_Cmnd *, int *); 992 static void __mega_runpendq(adapter_t *); 993 static int issue_scb_block(adapter_t *, u_char *);
+4 -3
drivers/scsi/megaraid/megaraid_mbox.c
··· 113 static void megaraid_mbox_display_scb(adapter_t *, scb_t *); 114 static void megaraid_mbox_setup_device_map(adapter_t *); 115 116 - static int megaraid_queue_command(struct scsi_cmnd *, 117 - void (*)(struct scsi_cmnd *)); 118 static scb_t *megaraid_mbox_build_cmd(adapter_t *, struct scsi_cmnd *, int *); 119 static void megaraid_mbox_runpendq(adapter_t *, scb_t *); 120 static void megaraid_mbox_prepare_pthru(adapter_t *, scb_t *, ··· 1483 * Queue entry point for mailbox based controllers. 1484 */ 1485 static int 1486 - megaraid_queue_command(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) 1487 { 1488 adapter_t *adapter; 1489 scb_t *scb; ··· 1511 megaraid_mbox_runpendq(adapter, scb); 1512 return if_busy; 1513 } 1514 1515 /** 1516 * megaraid_mbox_build_cmd - transform the mid-layer scsi commands
··· 113 static void megaraid_mbox_display_scb(adapter_t *, scb_t *); 114 static void megaraid_mbox_setup_device_map(adapter_t *); 115 116 + static int megaraid_queue_command(struct Scsi_Host *, struct scsi_cmnd *); 117 static scb_t *megaraid_mbox_build_cmd(adapter_t *, struct scsi_cmnd *, int *); 118 static void megaraid_mbox_runpendq(adapter_t *, scb_t *); 119 static void megaraid_mbox_prepare_pthru(adapter_t *, scb_t *, ··· 1484 * Queue entry point for mailbox based controllers. 1485 */ 1486 static int 1487 + megaraid_queue_command_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) 1488 { 1489 adapter_t *adapter; 1490 scb_t *scb; ··· 1512 megaraid_mbox_runpendq(adapter, scb); 1513 return if_busy; 1514 } 1515 + 1516 + static DEF_SCSI_QCMD(megaraid_queue_command) 1517 1518 /** 1519 * megaraid_mbox_build_cmd - transform the mid-layer scsi commands
+3 -1
drivers/scsi/megaraid/megaraid_sas.c
··· 1334 * @done: Callback entry point 1335 */ 1336 static int 1337 - megasas_queue_command(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *)) 1338 { 1339 u32 frame_count; 1340 struct megasas_cmd *cmd; ··· 1416 done(scmd); 1417 return 0; 1418 } 1419 1420 static struct megasas_instance *megasas_lookup_instance(u16 host_no) 1421 {
··· 1334 * @done: Callback entry point 1335 */ 1336 static int 1337 + megasas_queue_command_lck(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *)) 1338 { 1339 u32 frame_count; 1340 struct megasas_cmd *cmd; ··· 1416 done(scmd); 1417 return 0; 1418 } 1419 + 1420 + static DEF_SCSI_QCMD(megasas_queue_command) 1421 1422 static struct megasas_instance *megasas_lookup_instance(u16 host_no) 1423 {
+3 -1
drivers/scsi/mesh.c
··· 1627 * Called by midlayer with host locked to queue a new 1628 * request 1629 */ 1630 - static int mesh_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 1631 { 1632 struct mesh_state *ms; 1633 ··· 1647 1648 return 0; 1649 } 1650 1651 /* 1652 * Called to handle interrupts, either call by the interrupt
··· 1627 * Called by midlayer with host locked to queue a new 1628 * request 1629 */ 1630 + static int mesh_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 1631 { 1632 struct mesh_state *ms; 1633 ··· 1647 1648 return 0; 1649 } 1650 + 1651 + static DEF_SCSI_QCMD(mesh_queue) 1652 1653 /* 1654 * Called to handle interrupts, either call by the interrupt
+3 -1
drivers/scsi/mpt2sas/mpt2sas_scsih.c
··· 3315 * SCSI_MLQUEUE_HOST_BUSY if the entire host queue is full 3316 */ 3317 static int 3318 - _scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) 3319 { 3320 struct MPT2SAS_ADAPTER *ioc = shost_priv(scmd->device->host); 3321 struct MPT2SAS_DEVICE *sas_device_priv_data; ··· 3440 out: 3441 return SCSI_MLQUEUE_HOST_BUSY; 3442 } 3443 3444 /** 3445 * _scsih_normalize_sense - normalize descriptor and fixed format sense data
··· 3315 * SCSI_MLQUEUE_HOST_BUSY if the entire host queue is full 3316 */ 3317 static int 3318 + _scsih_qcmd_lck(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) 3319 { 3320 struct MPT2SAS_ADAPTER *ioc = shost_priv(scmd->device->host); 3321 struct MPT2SAS_DEVICE *sas_device_priv_data; ··· 3440 out: 3441 return SCSI_MLQUEUE_HOST_BUSY; 3442 } 3443 + 3444 + static DEF_SCSI_QCMD(_scsih_qcmd) 3445 3446 /** 3447 * _scsih_normalize_sense - normalize descriptor and fixed format sense data
+3 -1
drivers/scsi/ncr53c8xx.c
··· 8029 return 0; 8030 } 8031 8032 - static int ncr53c8xx_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *)) 8033 { 8034 struct ncb *np = ((struct host_data *) cmd->device->host->hostdata)->ncb; 8035 unsigned long flags; ··· 8067 8068 return sts; 8069 } 8070 8071 irqreturn_t ncr53c8xx_intr(int irq, void *dev_id) 8072 {
··· 8029 return 0; 8030 } 8031 8032 + static int ncr53c8xx_queue_command_lck (struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 8033 { 8034 struct ncb *np = ((struct host_data *) cmd->device->host->hostdata)->ncb; 8035 unsigned long flags; ··· 8067 8068 return sts; 8069 } 8070 + 8071 + static DEF_SCSI_QCMD(ncr53c8xx_queue_command) 8072 8073 irqreturn_t ncr53c8xx_intr(int irq, void *dev_id) 8074 {
+4 -3
drivers/scsi/nsp32.c
··· 196 static int nsp32_proc_info (struct Scsi_Host *, char *, char **, off_t, int, int); 197 198 static int nsp32_detect (struct pci_dev *pdev); 199 - static int nsp32_queuecommand(struct scsi_cmnd *, 200 - void (*done)(struct scsi_cmnd *)); 201 static const char *nsp32_info (struct Scsi_Host *); 202 static int nsp32_release (struct Scsi_Host *); 203 ··· 908 return TRUE; 909 } 910 911 - static int nsp32_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 912 { 913 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; 914 nsp32_target *target; ··· 1048 1049 return 0; 1050 } 1051 1052 /* initialize asic */ 1053 static int nsp32hw_init(nsp32_hw_data *data)
··· 196 static int nsp32_proc_info (struct Scsi_Host *, char *, char **, off_t, int, int); 197 198 static int nsp32_detect (struct pci_dev *pdev); 199 + static int nsp32_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 200 static const char *nsp32_info (struct Scsi_Host *); 201 static int nsp32_release (struct Scsi_Host *); 202 ··· 909 return TRUE; 910 } 911 912 + static int nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 913 { 914 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; 915 nsp32_target *target; ··· 1049 1050 return 0; 1051 } 1052 + 1053 + static DEF_SCSI_QCMD(nsp32_queuecommand) 1054 1055 /* initialize asic */ 1056 static int nsp32hw_init(nsp32_hw_data *data)
+1 -1
drivers/scsi/pas16.h
··· 118 static int pas16_biosparam(struct scsi_device *, struct block_device *, 119 sector_t, int*); 120 static int pas16_detect(struct scsi_host_template *); 121 - static int pas16_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 122 static int pas16_bus_reset(Scsi_Cmnd *); 123 124 #ifndef CMD_PER_LUN
··· 118 static int pas16_biosparam(struct scsi_device *, struct block_device *, 119 sector_t, int*); 120 static int pas16_detect(struct scsi_host_template *); 121 + static int pas16_queue_command(struct Scsi_Host *, struct scsi_cmnd *); 122 static int pas16_bus_reset(Scsi_Cmnd *); 123 124 #ifndef CMD_PER_LUN
+3 -1
drivers/scsi/pcmcia/nsp_cs.c
··· 184 SCpnt->scsi_done(SCpnt); 185 } 186 187 - static int nsp_queuecommand(struct scsi_cmnd *SCpnt, 188 void (*done)(struct scsi_cmnd *)) 189 { 190 #ifdef NSP_DEBUG ··· 263 #endif 264 return 0; 265 } 266 267 /* 268 * setup PIO FIFO transfer mode and enable/disable to data out
··· 184 SCpnt->scsi_done(SCpnt); 185 } 186 187 + static int nsp_queuecommand_lck(struct scsi_cmnd *SCpnt, 188 void (*done)(struct scsi_cmnd *)) 189 { 190 #ifdef NSP_DEBUG ··· 263 #endif 264 return 0; 265 } 266 + 267 + static DEF_SCSI_QCMD(nsp_queuecommand) 268 269 /* 270 * setup PIO FIFO transfer mode and enable/disable to data out
+1 -2
drivers/scsi/pcmcia/nsp_cs.h
··· 299 off_t offset, 300 int length, 301 int inout); 302 - static int nsp_queuecommand(struct scsi_cmnd *SCpnt, 303 - void (* done)(struct scsi_cmnd *SCpnt)); 304 305 /* Error handler */ 306 /*static int nsp_eh_abort (struct scsi_cmnd *SCpnt);*/
··· 299 off_t offset, 300 int length, 301 int inout); 302 + static int nsp_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *SCpnt); 303 304 /* Error handler */ 305 /*static int nsp_eh_abort (struct scsi_cmnd *SCpnt);*/
+3 -1
drivers/scsi/pcmcia/sym53c500_cs.c
··· 547 } 548 549 static int 550 - SYM53C500_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 551 { 552 int i; 553 int port_base = SCpnt->device->host->io_port; ··· 582 583 return 0; 584 } 585 586 static int 587 SYM53C500_host_reset(struct scsi_cmnd *SCpnt)
··· 547 } 548 549 static int 550 + SYM53C500_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 551 { 552 int i; 553 int port_base = SCpnt->device->host->io_port; ··· 582 583 return 0; 584 } 585 + 586 + static DEF_SCSI_QCMD(SYM53C500_queue) 587 588 static int 589 SYM53C500_host_reset(struct scsi_cmnd *SCpnt)
+3 -1
drivers/scsi/pmcraid.c
··· 3478 * SCSI_MLQUEUE_DEVICE_BUSY if device is busy 3479 * SCSI_MLQUEUE_HOST_BUSY if host is busy 3480 */ 3481 - static int pmcraid_queuecommand( 3482 struct scsi_cmnd *scsi_cmd, 3483 void (*done) (struct scsi_cmnd *) 3484 ) ··· 3583 3584 return rc; 3585 } 3586 3587 /** 3588 * pmcraid_open -char node "open" entry, allowed only users with admin access
··· 3478 * SCSI_MLQUEUE_DEVICE_BUSY if device is busy 3479 * SCSI_MLQUEUE_HOST_BUSY if host is busy 3480 */ 3481 + static int pmcraid_queuecommand_lck( 3482 struct scsi_cmnd *scsi_cmd, 3483 void (*done) (struct scsi_cmnd *) 3484 ) ··· 3583 3584 return rc; 3585 } 3586 + 3587 + static DEF_SCSI_QCMD(pmcraid_queuecommand) 3588 3589 /** 3590 * pmcraid_open -char node "open" entry, allowed only users with admin access
+3 -1
drivers/scsi/ppa.c
··· 798 return 0; 799 } 800 801 - static int ppa_queuecommand(struct scsi_cmnd *cmd, 802 void (*done) (struct scsi_cmnd *)) 803 { 804 ppa_struct *dev = ppa_dev(cmd->device->host); ··· 820 821 return 0; 822 } 823 824 /* 825 * Apparently the disk->capacity attribute is off by 1 sector
··· 798 return 0; 799 } 800 801 + static int ppa_queuecommand_lck(struct scsi_cmnd *cmd, 802 void (*done) (struct scsi_cmnd *)) 803 { 804 ppa_struct *dev = ppa_dev(cmd->device->host); ··· 820 821 return 0; 822 } 823 + 824 + static DEF_SCSI_QCMD(ppa_queuecommand) 825 826 /* 827 * Apparently the disk->capacity attribute is off by 1 sector
+3 -1
drivers/scsi/ps3rom.c
··· 211 return 0; 212 } 213 214 - static int ps3rom_queuecommand(struct scsi_cmnd *cmd, 215 void (*done)(struct scsi_cmnd *)) 216 { 217 struct ps3rom_private *priv = shost_priv(cmd->device->host); ··· 259 260 return 0; 261 } 262 263 static int decode_lv1_status(u64 status, unsigned char *sense_key, 264 unsigned char *asc, unsigned char *ascq)
··· 211 return 0; 212 } 213 214 + static int ps3rom_queuecommand_lck(struct scsi_cmnd *cmd, 215 void (*done)(struct scsi_cmnd *)) 216 { 217 struct ps3rom_private *priv = shost_priv(cmd->device->host); ··· 259 260 return 0; 261 } 262 + 263 + static DEF_SCSI_QCMD(ps3rom_queuecommand) 264 265 static int decode_lv1_status(u64 status, unsigned char *sense_key, 266 unsigned char *asc, unsigned char *ascq)
+3 -1
drivers/scsi/qla1280.c
··· 727 * context which is a big NO! NO!. 728 **************************************************************************/ 729 static int 730 - qla1280_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) 731 { 732 struct Scsi_Host *host = cmd->device->host; 733 struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata; ··· 755 #endif 756 return status; 757 } 758 759 enum action { 760 ABORT_COMMAND,
··· 727 * context which is a big NO! NO!. 728 **************************************************************************/ 729 static int 730 + qla1280_queuecommand_lck(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) 731 { 732 struct Scsi_Host *host = cmd->device->host; 733 struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata; ··· 755 #endif 756 return status; 757 } 758 + 759 + static DEF_SCSI_QCMD(qla1280_queuecommand) 760 761 enum action { 762 ABORT_COMMAND,
+4 -3
drivers/scsi/qla2xxx/qla_os.c
··· 179 static int qla2xxx_scan_finished(struct Scsi_Host *, unsigned long time); 180 static void qla2xxx_scan_start(struct Scsi_Host *); 181 static void qla2xxx_slave_destroy(struct scsi_device *); 182 - static int qla2xxx_queuecommand(struct scsi_cmnd *cmd, 183 - void (*fn)(struct scsi_cmnd *)); 184 static int qla2xxx_eh_abort(struct scsi_cmnd *); 185 static int qla2xxx_eh_device_reset(struct scsi_cmnd *); 186 static int qla2xxx_eh_target_reset(struct scsi_cmnd *); ··· 534 } 535 536 static int 537 - qla2xxx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 538 { 539 scsi_qla_host_t *vha = shost_priv(cmd->device->host); 540 fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; ··· 607 608 return 0; 609 } 610 611 612 /*
··· 179 static int qla2xxx_scan_finished(struct Scsi_Host *, unsigned long time); 180 static void qla2xxx_scan_start(struct Scsi_Host *); 181 static void qla2xxx_slave_destroy(struct scsi_device *); 182 + static int qla2xxx_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmd); 183 static int qla2xxx_eh_abort(struct scsi_cmnd *); 184 static int qla2xxx_eh_device_reset(struct scsi_cmnd *); 185 static int qla2xxx_eh_target_reset(struct scsi_cmnd *); ··· 535 } 536 537 static int 538 + qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 539 { 540 scsi_qla_host_t *vha = shost_priv(cmd->device->host); 541 fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; ··· 608 609 return 0; 610 } 611 + 612 + static DEF_SCSI_QCMD(qla2xxx_queuecommand) 613 614 615 /*
+4 -3
drivers/scsi/qla4xxx/ql4_os.c
··· 79 /* 80 * SCSI host template entry points 81 */ 82 - static int qla4xxx_queuecommand(struct scsi_cmnd *cmd, 83 - void (*done) (struct scsi_cmnd *)); 84 static int qla4xxx_eh_abort(struct scsi_cmnd *cmd); 85 static int qla4xxx_eh_device_reset(struct scsi_cmnd *cmd); 86 static int qla4xxx_eh_target_reset(struct scsi_cmnd *cmd); ··· 463 * completion handling). Unfortunely, it sometimes calls the scheduler 464 * in interrupt context which is a big NO! NO!. 465 **/ 466 - static int qla4xxx_queuecommand(struct scsi_cmnd *cmd, 467 void (*done)(struct scsi_cmnd *)) 468 { 469 struct scsi_qla_host *ha = to_qla_host(cmd->device->host); ··· 536 537 return 0; 538 } 539 540 /** 541 * qla4xxx_mem_free - frees memory allocated to adapter
··· 79 /* 80 * SCSI host template entry points 81 */ 82 + static int qla4xxx_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmd); 83 static int qla4xxx_eh_abort(struct scsi_cmnd *cmd); 84 static int qla4xxx_eh_device_reset(struct scsi_cmnd *cmd); 85 static int qla4xxx_eh_target_reset(struct scsi_cmnd *cmd); ··· 464 * completion handling). Unfortunely, it sometimes calls the scheduler 465 * in interrupt context which is a big NO! NO!. 466 **/ 467 + static int qla4xxx_queuecommand_lck(struct scsi_cmnd *cmd, 468 void (*done)(struct scsi_cmnd *)) 469 { 470 struct scsi_qla_host *ha = to_qla_host(cmd->device->host); ··· 537 538 return 0; 539 } 540 + 541 + static DEF_SCSI_QCMD(qla4xxx_queuecommand) 542 543 /** 544 * qla4xxx_mem_free - frees memory allocated to adapter
+3 -1
drivers/scsi/qlogicfas408.c
··· 439 * Queued command 440 */ 441 442 - int qlogicfas408_queuecommand(struct scsi_cmnd *cmd, 443 void (*done) (struct scsi_cmnd *)) 444 { 445 struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd); ··· 458 ql_icmd(cmd); 459 return 0; 460 } 461 462 /* 463 * Return bios parameters
··· 439 * Queued command 440 */ 441 442 + static int qlogicfas408_queuecommand_lck(struct scsi_cmnd *cmd, 443 void (*done) (struct scsi_cmnd *)) 444 { 445 struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd); ··· 458 ql_icmd(cmd); 459 return 0; 460 } 461 + 462 + DEF_SCSI_QCMD(qlogicfas408_queuecommand) 463 464 /* 465 * Return bios parameters
+1 -2
drivers/scsi/qlogicfas408.h
··· 103 #define get_priv_by_host(x) (struct qlogicfas408_priv *)&((x)->hostdata[0]) 104 105 irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id); 106 - int qlogicfas408_queuecommand(struct scsi_cmnd * cmd, 107 - void (*done) (struct scsi_cmnd *)); 108 int qlogicfas408_biosparam(struct scsi_device * disk, 109 struct block_device *dev, 110 sector_t capacity, int ip[]);
··· 103 #define get_priv_by_host(x) (struct qlogicfas408_priv *)&((x)->hostdata[0]) 104 105 irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id); 106 + int qlogicfas408_queuecommand(struct Scsi_Host *h, struct scsi_cmnd * cmd); 107 int qlogicfas408_biosparam(struct scsi_device * disk, 108 struct block_device *dev, 109 sector_t capacity, int ip[]);
+3 -1
drivers/scsi/qlogicpti.c
··· 1003 * 1004 * "This code must fly." -davem 1005 */ 1006 - static int qlogicpti_queuecommand(struct scsi_cmnd *Cmnd, void (*done)(struct scsi_cmnd *)) 1007 { 1008 struct Scsi_Host *host = Cmnd->device->host; 1009 struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata; ··· 1051 done(Cmnd); 1052 return 1; 1053 } 1054 1055 static int qlogicpti_return_status(struct Status_Entry *sts, int id) 1056 {
··· 1003 * 1004 * "This code must fly." -davem 1005 */ 1006 + static int qlogicpti_queuecommand_lck(struct scsi_cmnd *Cmnd, void (*done)(struct scsi_cmnd *)) 1007 { 1008 struct Scsi_Host *host = Cmnd->device->host; 1009 struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata; ··· 1051 done(Cmnd); 1052 return 1; 1053 } 1054 + 1055 + static DEF_SCSI_QCMD(qlogicpti_queuecommand) 1056 1057 static int qlogicpti_return_status(struct Status_Entry *sts, int id) 1058 {
+5 -13
drivers/scsi/scsi.c
··· 634 * Description: a serial number identifies a request for error recovery 635 * and debugging purposes. Protected by the Host_Lock of host. 636 */ 637 - static inline void scsi_cmd_get_serial(struct Scsi_Host *host, struct scsi_cmnd *cmd) 638 { 639 cmd->serial_number = host->cmd_serial_number++; 640 if (cmd->serial_number == 0) 641 cmd->serial_number = host->cmd_serial_number++; 642 } 643 644 /** 645 * scsi_dispatch_command - Dispatch a command to the low-level driver. ··· 652 int scsi_dispatch_cmd(struct scsi_cmnd *cmd) 653 { 654 struct Scsi_Host *host = cmd->device->host; 655 - unsigned long flags = 0; 656 unsigned long timeout; 657 int rtn = 0; 658 ··· 737 goto out; 738 } 739 740 - spin_lock_irqsave(host->host_lock, flags); 741 - /* 742 - * AK: unlikely race here: for some reason the timer could 743 - * expire before the serial number is set up below. 744 - * 745 - * TODO: kill serial or move to blk layer 746 - */ 747 - scsi_cmd_get_serial(host, cmd); 748 - 749 if (unlikely(host->shost_state == SHOST_DEL)) { 750 cmd->result = (DID_NO_CONNECT << 16); 751 scsi_done(cmd); 752 } else { 753 trace_scsi_dispatch_cmd_start(cmd); 754 - rtn = host->hostt->queuecommand(cmd, scsi_done); 755 } 756 - spin_unlock_irqrestore(host->host_lock, flags); 757 if (rtn) { 758 trace_scsi_dispatch_cmd_error(cmd, rtn); 759 if (rtn != SCSI_MLQUEUE_DEVICE_BUSY &&
··· 634 * Description: a serial number identifies a request for error recovery 635 * and debugging purposes. Protected by the Host_Lock of host. 636 */ 637 + void scsi_cmd_get_serial(struct Scsi_Host *host, struct scsi_cmnd *cmd) 638 { 639 cmd->serial_number = host->cmd_serial_number++; 640 if (cmd->serial_number == 0) 641 cmd->serial_number = host->cmd_serial_number++; 642 } 643 + EXPORT_SYMBOL(scsi_cmd_get_serial); 644 645 /** 646 * scsi_dispatch_command - Dispatch a command to the low-level driver. ··· 651 int scsi_dispatch_cmd(struct scsi_cmnd *cmd) 652 { 653 struct Scsi_Host *host = cmd->device->host; 654 unsigned long timeout; 655 int rtn = 0; 656 ··· 737 goto out; 738 } 739 740 if (unlikely(host->shost_state == SHOST_DEL)) { 741 cmd->result = (DID_NO_CONNECT << 16); 742 scsi_done(cmd); 743 } else { 744 trace_scsi_dispatch_cmd_start(cmd); 745 + cmd->scsi_done = scsi_done; 746 + rtn = host->hostt->queuecommand(host, cmd); 747 } 748 + 749 if (rtn) { 750 trace_scsi_dispatch_cmd_error(cmd, rtn); 751 if (rtn != SCSI_MLQUEUE_DEVICE_BUSY &&
+3 -1
drivers/scsi/scsi_debug.c
··· 3538 } 3539 3540 static 3541 - int scsi_debug_queuecommand(struct scsi_cmnd *SCpnt, done_funct_t done) 3542 { 3543 unsigned char *cmd = (unsigned char *) SCpnt->cmnd; 3544 int len, k; ··· 3883 return schedule_resp(SCpnt, devip, done, errsts, 3884 (delay_override ? 0 : scsi_debug_delay)); 3885 } 3886 3887 static struct scsi_host_template sdebug_driver_template = { 3888 .proc_info = scsi_debug_proc_info,
··· 3538 } 3539 3540 static 3541 + int scsi_debug_queuecommand_lck(struct scsi_cmnd *SCpnt, done_funct_t done) 3542 { 3543 unsigned char *cmd = (unsigned char *) SCpnt->cmnd; 3544 int len, k; ··· 3883 return schedule_resp(SCpnt, devip, done, errsts, 3884 (delay_override ? 0 : scsi_debug_delay)); 3885 } 3886 + 3887 + static DEF_SCSI_QCMD(scsi_debug_queuecommand) 3888 3889 static struct scsi_host_template sdebug_driver_template = { 3890 .proc_info = scsi_debug_proc_info,
+2 -4
drivers/scsi/scsi_error.c
··· 773 struct Scsi_Host *shost = sdev->host; 774 DECLARE_COMPLETION_ONSTACK(done); 775 unsigned long timeleft; 776 - unsigned long flags; 777 struct scsi_eh_save ses; 778 int rtn; 779 780 scsi_eh_prep_cmnd(scmd, &ses, cmnd, cmnd_size, sense_bytes); 781 shost->eh_action = &done; 782 783 - spin_lock_irqsave(shost->host_lock, flags); 784 scsi_log_send(scmd); 785 - shost->hostt->queuecommand(scmd, scsi_eh_done); 786 - spin_unlock_irqrestore(shost->host_lock, flags); 787 788 timeleft = wait_for_completion_timeout(&done, timeout); 789
··· 773 struct Scsi_Host *shost = sdev->host; 774 DECLARE_COMPLETION_ONSTACK(done); 775 unsigned long timeleft; 776 struct scsi_eh_save ses; 777 int rtn; 778 779 scsi_eh_prep_cmnd(scmd, &ses, cmnd, cmnd_size, sense_bytes); 780 shost->eh_action = &done; 781 782 scsi_log_send(scmd); 783 + scmd->scsi_done = scsi_eh_done; 784 + shost->hostt->queuecommand(shost, scmd); 785 786 timeleft = wait_for_completion_timeout(&done, timeout); 787
+3 -1
drivers/scsi/stex.c
··· 572 } 573 574 static int 575 - stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *)) 576 { 577 struct st_hba *hba; 578 struct Scsi_Host *host; ··· 697 hba->send(hba, req, tag); 698 return 0; 699 } 700 701 static void stex_scsi_done(struct st_ccb *ccb) 702 {
··· 572 } 573 574 static int 575 + stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 576 { 577 struct st_hba *hba; 578 struct Scsi_Host *host; ··· 697 hba->send(hba, req, tag); 698 return 0; 699 } 700 + 701 + static DEF_SCSI_QCMD(stex_queuecommand) 702 703 static void stex_scsi_done(struct st_ccb *ccb) 704 {
+3 -1
drivers/scsi/sun3_NCR5380.c
··· 908 */ 909 910 /* Only make static if a wrapper function is used */ 911 - static int NCR5380_queue_command(struct scsi_cmnd *cmd, 912 void (*done)(struct scsi_cmnd *)) 913 { 914 SETUP_HOSTDATA(cmd->device->host); ··· 1018 NCR5380_main(NULL); 1019 return 0; 1020 } 1021 1022 /* 1023 * Function : NCR5380_main (void)
··· 908 */ 909 910 /* Only make static if a wrapper function is used */ 911 + static int NCR5380_queue_command_lck(struct scsi_cmnd *cmd, 912 void (*done)(struct scsi_cmnd *)) 913 { 914 SETUP_HOSTDATA(cmd->device->host); ··· 1018 NCR5380_main(NULL); 1019 return 0; 1020 } 1021 + 1022 + static DEF_SCSI_QCMD(NCR5380_queue_command) 1023 1024 /* 1025 * Function : NCR5380_main (void)
+1 -2
drivers/scsi/sun3_scsi.h
··· 51 static int sun3scsi_detect (struct scsi_host_template *); 52 static const char *sun3scsi_info (struct Scsi_Host *); 53 static int sun3scsi_bus_reset(struct scsi_cmnd *); 54 - static int sun3scsi_queue_command(struct scsi_cmnd *, 55 - void (*done)(struct scsi_cmnd *)); 56 static int sun3scsi_release (struct Scsi_Host *); 57 58 #ifndef CMD_PER_LUN
··· 51 static int sun3scsi_detect (struct scsi_host_template *); 52 static const char *sun3scsi_info (struct Scsi_Host *); 53 static int sun3scsi_bus_reset(struct scsi_cmnd *); 54 + static int sun3scsi_queue_command(struct Scsi_Host *, struct scsi_cmnd *); 55 static int sun3scsi_release (struct Scsi_Host *); 56 57 #ifndef CMD_PER_LUN
+3 -1
drivers/scsi/sym53c416.c
··· 734 return info; 735 } 736 737 - int sym53c416_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 738 { 739 int base; 740 unsigned long flags = 0; ··· 760 spin_unlock_irqrestore(&sym53c416_lock, flags); 761 return 0; 762 } 763 764 static int sym53c416_host_reset(Scsi_Cmnd *SCpnt) 765 {
··· 734 return info; 735 } 736 737 + static int sym53c416_queuecommand_lck(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 738 { 739 int base; 740 unsigned long flags = 0; ··· 760 spin_unlock_irqrestore(&sym53c416_lock, flags); 761 return 0; 762 } 763 + 764 + DEF_SCSI_QCMD(sym53c416_queuecommand) 765 766 static int sym53c416_host_reset(Scsi_Cmnd *SCpnt) 767 {
+1 -1
drivers/scsi/sym53c416.h
··· 25 static int sym53c416_detect(struct scsi_host_template *); 26 static const char *sym53c416_info(struct Scsi_Host *); 27 static int sym53c416_release(struct Scsi_Host *); 28 - static int sym53c416_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 29 static int sym53c416_host_reset(Scsi_Cmnd *); 30 static int sym53c416_bios_param(struct scsi_device *, struct block_device *, 31 sector_t, int *);
··· 25 static int sym53c416_detect(struct scsi_host_template *); 26 static const char *sym53c416_info(struct Scsi_Host *); 27 static int sym53c416_release(struct Scsi_Host *); 28 + static int sym53c416_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 29 static int sym53c416_host_reset(Scsi_Cmnd *); 30 static int sym53c416_bios_param(struct scsi_device *, struct block_device *, 31 sector_t, int *);
+3 -1
drivers/scsi/sym53c8xx_2/sym_glue.c
··· 505 * queuecommand method. Entered with the host adapter lock held and 506 * interrupts disabled. 507 */ 508 - static int sym53c8xx_queue_command(struct scsi_cmnd *cmd, 509 void (*done)(struct scsi_cmnd *)) 510 { 511 struct sym_hcb *np = SYM_SOFTC_PTR(cmd); ··· 535 return SCSI_MLQUEUE_HOST_BUSY; 536 return 0; 537 } 538 539 /* 540 * Linux entry point of the interrupt handler.
··· 505 * queuecommand method. Entered with the host adapter lock held and 506 * interrupts disabled. 507 */ 508 + static int sym53c8xx_queue_command_lck(struct scsi_cmnd *cmd, 509 void (*done)(struct scsi_cmnd *)) 510 { 511 struct sym_hcb *np = SYM_SOFTC_PTR(cmd); ··· 535 return SCSI_MLQUEUE_HOST_BUSY; 536 return 0; 537 } 538 + 539 + static DEF_SCSI_QCMD(sym53c8xx_queue_command) 540 541 /* 542 * Linux entry point of the interrupt handler.
+1 -2
drivers/scsi/t128.h
··· 96 static int t128_biosparam(struct scsi_device *, struct block_device *, 97 sector_t, int*); 98 static int t128_detect(struct scsi_host_template *); 99 - static int t128_queue_command(struct scsi_cmnd *, 100 - void (*done)(struct scsi_cmnd *)); 101 static int t128_bus_reset(struct scsi_cmnd *); 102 103 #ifndef CMD_PER_LUN
··· 96 static int t128_biosparam(struct scsi_device *, struct block_device *, 97 sector_t, int*); 98 static int t128_detect(struct scsi_host_template *); 99 + static int t128_queue_command(struct Scsi_Host *, struct scsi_cmnd *); 100 static int t128_bus_reset(struct scsi_cmnd *); 101 102 #ifndef CMD_PER_LUN
+3 -1
drivers/scsi/tmscsim.c
··· 1883 return; 1884 } 1885 1886 - static int DC390_queuecommand(struct scsi_cmnd *cmd, 1887 void (*done)(struct scsi_cmnd *)) 1888 { 1889 struct scsi_device *sdev = cmd->device; ··· 1943 device_busy: 1944 return SCSI_MLQUEUE_DEVICE_BUSY; 1945 } 1946 1947 static void dc390_dumpinfo (struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB) 1948 {
··· 1883 return; 1884 } 1885 1886 + static int DC390_queuecommand_lck(struct scsi_cmnd *cmd, 1887 void (*done)(struct scsi_cmnd *)) 1888 { 1889 struct scsi_device *sdev = cmd->device; ··· 1943 device_busy: 1944 return SCSI_MLQUEUE_DEVICE_BUSY; 1945 } 1946 + 1947 + static DEF_SCSI_QCMD(DC390_queuecommand) 1948 1949 static void dc390_dumpinfo (struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB) 1950 {
+4 -2
drivers/scsi/u14-34f.c
··· 433 434 static int u14_34f_detect(struct scsi_host_template *); 435 static int u14_34f_release(struct Scsi_Host *); 436 - static int u14_34f_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); 437 static int u14_34f_eh_abort(struct scsi_cmnd *); 438 static int u14_34f_eh_host_reset(struct scsi_cmnd *); 439 static int u14_34f_bios_param(struct scsi_device *, struct block_device *, ··· 1248 1249 } 1250 1251 - static int u14_34f_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { 1252 unsigned int i, j, k; 1253 struct mscp *cpp; 1254 ··· 1328 HD(j)->cp_stat[i] = IN_USE; 1329 return 0; 1330 } 1331 1332 static int u14_34f_eh_abort(struct scsi_cmnd *SCarg) { 1333 unsigned int i, j;
··· 433 434 static int u14_34f_detect(struct scsi_host_template *); 435 static int u14_34f_release(struct Scsi_Host *); 436 + static int u14_34f_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 437 static int u14_34f_eh_abort(struct scsi_cmnd *); 438 static int u14_34f_eh_host_reset(struct scsi_cmnd *); 439 static int u14_34f_bios_param(struct scsi_device *, struct block_device *, ··· 1248 1249 } 1250 1251 + static int u14_34f_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { 1252 unsigned int i, j, k; 1253 struct mscp *cpp; 1254 ··· 1328 HD(j)->cp_stat[i] = IN_USE; 1329 return 0; 1330 } 1331 + 1332 + static DEF_SCSI_QCMD(u14_34f_queuecommand) 1333 1334 static int u14_34f_eh_abort(struct scsi_cmnd *SCarg) { 1335 unsigned int i, j;
+3 -1
drivers/scsi/ultrastor.c
··· 700 mscp->transfer_data_length = transfer_length; 701 } 702 703 - static int ultrastor_queuecommand(struct scsi_cmnd *SCpnt, 704 void (*done) (struct scsi_cmnd *)) 705 { 706 struct mscp *my_mscp; ··· 824 825 return 0; 826 } 827 828 /* This code must deal with 2 cases: 829
··· 700 mscp->transfer_data_length = transfer_length; 701 } 702 703 + static int ultrastor_queuecommand_lck(struct scsi_cmnd *SCpnt, 704 void (*done) (struct scsi_cmnd *)) 705 { 706 struct mscp *my_mscp; ··· 824 825 return 0; 826 } 827 + 828 + static DEF_SCSI_QCMD(ultrastor_queuecommand) 829 830 /* This code must deal with 2 cases: 831
+1 -2
drivers/scsi/ultrastor.h
··· 15 16 static int ultrastor_detect(struct scsi_host_template *); 17 static const char *ultrastor_info(struct Scsi_Host *shpnt); 18 - static int ultrastor_queuecommand(struct scsi_cmnd *, 19 - void (*done)(struct scsi_cmnd *)); 20 static int ultrastor_abort(struct scsi_cmnd *); 21 static int ultrastor_host_reset(struct scsi_cmnd *); 22 static int ultrastor_biosparam(struct scsi_device *, struct block_device *,
··· 15 16 static int ultrastor_detect(struct scsi_host_template *); 17 static const char *ultrastor_info(struct Scsi_Host *shpnt); 18 + static int ultrastor_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 19 static int ultrastor_abort(struct scsi_cmnd *); 20 static int ultrastor_host_reset(struct scsi_cmnd *); 21 static int ultrastor_biosparam(struct scsi_device *, struct block_device *,
+3 -1
drivers/scsi/vmw_pvscsi.c
··· 690 return 0; 691 } 692 693 - static int pvscsi_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 694 { 695 struct Scsi_Host *host = cmd->device->host; 696 struct pvscsi_adapter *adapter = shost_priv(host); ··· 718 719 return 0; 720 } 721 722 static int pvscsi_abort(struct scsi_cmnd *cmd) 723 {
··· 690 return 0; 691 } 692 693 + static int pvscsi_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 694 { 695 struct Scsi_Host *host = cmd->device->host; 696 struct pvscsi_adapter *adapter = shost_priv(host); ··· 718 719 return 0; 720 } 721 + 722 + static DEF_SCSI_QCMD(pvscsi_queue) 723 724 static int pvscsi_abort(struct scsi_cmnd *cmd) 725 {
+4 -2
drivers/scsi/wd33c93.c
··· 371 msg[1] = offset; 372 } 373 374 - int 375 - wd33c93_queuecommand(struct scsi_cmnd *cmd, 376 void (*done)(struct scsi_cmnd *)) 377 { 378 struct WD33C93_hostdata *hostdata; ··· 467 spin_unlock_irq(&hostdata->lock); 468 return 0; 469 } 470 471 /* 472 * This routine attempts to start a scsi command. If the host_card is
··· 371 msg[1] = offset; 372 } 373 374 + static int 375 + wd33c93_queuecommand_lck(struct scsi_cmnd *cmd, 376 void (*done)(struct scsi_cmnd *)) 377 { 378 struct WD33C93_hostdata *hostdata; ··· 467 spin_unlock_irq(&hostdata->lock); 468 return 0; 469 } 470 + 471 + DEF_SCSI_QCMD(wd33c93_queuecommand) 472 473 /* 474 * This routine attempts to start a scsi command. If the host_card is
+1 -2
drivers/scsi/wd33c93.h
··· 343 void wd33c93_init (struct Scsi_Host *instance, const wd33c93_regs regs, 344 dma_setup_t setup, dma_stop_t stop, int clock_freq); 345 int wd33c93_abort (struct scsi_cmnd *cmd); 346 - int wd33c93_queuecommand (struct scsi_cmnd *cmd, 347 - void (*done)(struct scsi_cmnd *)); 348 void wd33c93_intr (struct Scsi_Host *instance); 349 int wd33c93_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int); 350 int wd33c93_host_reset (struct scsi_cmnd *);
··· 343 void wd33c93_init (struct Scsi_Host *instance, const wd33c93_regs regs, 344 dma_setup_t setup, dma_stop_t stop, int clock_freq); 345 int wd33c93_abort (struct scsi_cmnd *cmd); 346 + int wd33c93_queuecommand (struct Scsi_Host *h, struct scsi_cmnd *cmd); 347 void wd33c93_intr (struct Scsi_Host *instance); 348 int wd33c93_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int); 349 int wd33c93_host_reset (struct scsi_cmnd *);
+3 -1
drivers/scsi/wd7000.c
··· 1082 return IRQ_HANDLED; 1083 } 1084 1085 - static int wd7000_queuecommand(struct scsi_cmnd *SCpnt, 1086 void (*done)(struct scsi_cmnd *)) 1087 { 1088 Scb *scb; ··· 1138 1139 return 0; 1140 } 1141 1142 static int wd7000_diagnostics(Adapter * host, int code) 1143 {
··· 1082 return IRQ_HANDLED; 1083 } 1084 1085 + static int wd7000_queuecommand_lck(struct scsi_cmnd *SCpnt, 1086 void (*done)(struct scsi_cmnd *)) 1087 { 1088 Scb *scb; ··· 1138 1139 return 0; 1140 } 1141 + 1142 + static DEF_SCSI_QCMD(wd7000_queuecommand) 1143 1144 static int wd7000_diagnostics(Adapter * host, int code) 1145 {
+4 -3
drivers/staging/hv/storvsc_drv.c
··· 72 73 /* Static decl */ 74 static int storvsc_probe(struct device *dev); 75 - static int storvsc_queuecommand(struct scsi_cmnd *scmnd, 76 - void (*done)(struct scsi_cmnd *)); 77 static int storvsc_device_alloc(struct scsi_device *); 78 static int storvsc_device_configure(struct scsi_device *); 79 static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd); ··· 594 /* 595 * storvsc_queuecommand - Initiate command processing 596 */ 597 - static int storvsc_queuecommand(struct scsi_cmnd *scmnd, 598 void (*done)(struct scsi_cmnd *)) 599 { 600 int ret; ··· 781 782 return ret; 783 } 784 785 static int storvsc_merge_bvec(struct request_queue *q, 786 struct bvec_merge_data *bmd, struct bio_vec *bvec)
··· 72 73 /* Static decl */ 74 static int storvsc_probe(struct device *dev); 75 + static int storvsc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd); 76 static int storvsc_device_alloc(struct scsi_device *); 77 static int storvsc_device_configure(struct scsi_device *); 78 static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd); ··· 595 /* 596 * storvsc_queuecommand - Initiate command processing 597 */ 598 + static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd, 599 void (*done)(struct scsi_cmnd *)) 600 { 601 int ret; ··· 782 783 return ret; 784 } 785 + 786 + static DEF_SCSI_QCMD(storvsc_queuecommand) 787 788 static int storvsc_merge_bvec(struct request_queue *q, 789 struct bvec_merge_data *bmd, struct bio_vec *bvec)
+3 -1
drivers/staging/keucr/scsiglue.c
··· 87 88 /* This is always called with scsi_lock(host) held */ 89 //----- queuecommand() --------------------- 90 - static int queuecommand(struct scsi_cmnd *srb, void (*done)(struct scsi_cmnd *)) 91 { 92 struct us_data *us = host_to_us(srb->device->host); 93 ··· 116 117 return 0; 118 } 119 120 /*********************************************************************** 121 * Error handling functions
··· 87 88 /* This is always called with scsi_lock(host) held */ 89 //----- queuecommand() --------------------- 90 + static int queuecommand_lck(struct scsi_cmnd *srb, void (*done)(struct scsi_cmnd *)) 91 { 92 struct us_data *us = host_to_us(srb->device->host); 93 ··· 116 117 return 0; 118 } 119 + 120 + static DEF_SCSI_QCMD(queuecommand) 121 122 /*********************************************************************** 123 * Error handling functions
+4 -2
drivers/usb/image/microtek.c
··· 364 } 365 366 static int 367 - mts_scsi_queuecommand(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback); 368 369 static void mts_transfer_cleanup( struct urb *transfer ); 370 static void mts_do_sg(struct urb * transfer); ··· 573 574 575 static int 576 - mts_scsi_queuecommand(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback) 577 { 578 struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]); 579 int err = 0; ··· 625 out: 626 return err; 627 } 628 629 static struct scsi_host_template mts_scsi_host_template = { 630 .module = THIS_MODULE,
··· 364 } 365 366 static int 367 + mts_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *srb); 368 369 static void mts_transfer_cleanup( struct urb *transfer ); 370 static void mts_do_sg(struct urb * transfer); ··· 573 574 575 static int 576 + mts_scsi_queuecommand_lck(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback) 577 { 578 struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]); 579 int err = 0; ··· 625 out: 626 return err; 627 } 628 + 629 + static DEF_SCSI_QCMD(mts_scsi_queuecommand) 630 631 static struct scsi_host_template mts_scsi_host_template = { 632 .module = THIS_MODULE,
+3 -1
drivers/usb/storage/scsiglue.c
··· 285 286 /* queue a command */ 287 /* This is always called with scsi_lock(host) held */ 288 - static int queuecommand(struct scsi_cmnd *srb, 289 void (*done)(struct scsi_cmnd *)) 290 { 291 struct us_data *us = host_to_us(srb->device->host); ··· 314 315 return 0; 316 } 317 318 /*********************************************************************** 319 * Error handling functions
··· 285 286 /* queue a command */ 287 /* This is always called with scsi_lock(host) held */ 288 + static int queuecommand_lck(struct scsi_cmnd *srb, 289 void (*done)(struct scsi_cmnd *)) 290 { 291 struct us_data *us = host_to_us(srb->device->host); ··· 314 315 return 0; 316 } 317 + 318 + static DEF_SCSI_QCMD(queuecommand) 319 320 /*********************************************************************** 321 * Error handling functions
+3 -1
drivers/usb/storage/uas.c
··· 430 return 0; 431 } 432 433 - static int uas_queuecommand(struct scsi_cmnd *cmnd, 434 void (*done)(struct scsi_cmnd *)) 435 { 436 struct scsi_device *sdev = cmnd->device; ··· 487 488 return 0; 489 } 490 491 static int uas_eh_abort_handler(struct scsi_cmnd *cmnd) 492 {
··· 430 return 0; 431 } 432 433 + static int uas_queuecommand_lck(struct scsi_cmnd *cmnd, 434 void (*done)(struct scsi_cmnd *)) 435 { 436 struct scsi_device *sdev = cmnd->device; ··· 487 488 return 0; 489 } 490 + 491 + static DEF_SCSI_QCMD(uas_queuecommand) 492 493 static int uas_eh_abort_handler(struct scsi_cmnd *cmnd) 494 {
+1 -1
include/linux/libata.h
··· 986 unsigned long, struct ata_port_operations *); 987 extern int ata_scsi_detect(struct scsi_host_template *sht); 988 extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); 989 - extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); 990 extern int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *dev, 991 int cmd, void __user *arg); 992 extern void ata_sas_port_destroy(struct ata_port *);
··· 986 unsigned long, struct ata_port_operations *); 987 extern int ata_scsi_detect(struct scsi_host_template *sht); 988 extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); 989 + extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd); 990 extern int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *dev, 991 int cmd, void __user *arg); 992 extern void ata_sas_port_destroy(struct ata_port *);
+1 -2
include/scsi/libfc.h
··· 1006 /* 1007 * SCSI INTERACTION LAYER 1008 *****************************/ 1009 - int fc_queuecommand(struct scsi_cmnd *, 1010 - void (*done)(struct scsi_cmnd *)); 1011 int fc_eh_abort(struct scsi_cmnd *); 1012 int fc_eh_device_reset(struct scsi_cmnd *); 1013 int fc_eh_host_reset(struct scsi_cmnd *);
··· 1006 /* 1007 * SCSI INTERACTION LAYER 1008 *****************************/ 1009 + int fc_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); 1010 int fc_eh_abort(struct scsi_cmnd *); 1011 int fc_eh_device_reset(struct scsi_cmnd *); 1012 int fc_eh_host_reset(struct scsi_cmnd *);
+1 -2
include/scsi/libiscsi.h
··· 341 extern int iscsi_eh_recover_target(struct scsi_cmnd *sc); 342 extern int iscsi_eh_session_reset(struct scsi_cmnd *sc); 343 extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); 344 - extern int iscsi_queuecommand(struct scsi_cmnd *sc, 345 - void (*done)(struct scsi_cmnd *)); 346 347 /* 348 * iSCSI host helpers.
··· 341 extern int iscsi_eh_recover_target(struct scsi_cmnd *sc); 342 extern int iscsi_eh_session_reset(struct scsi_cmnd *sc); 343 extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); 344 + extern int iscsi_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *sc); 345 346 /* 347 * iSCSI host helpers.
+1 -2
include/scsi/libsas.h
··· 621 int sas_phy_enable(struct sas_phy *phy, int enabled); 622 int sas_phy_reset(struct sas_phy *phy, int hard_reset); 623 int sas_queue_up(struct sas_task *task); 624 - extern int sas_queuecommand(struct scsi_cmnd *, 625 - void (*scsi_done)(struct scsi_cmnd *)); 626 extern int sas_target_alloc(struct scsi_target *); 627 extern int sas_slave_alloc(struct scsi_device *); 628 extern int sas_slave_configure(struct scsi_device *);
··· 621 int sas_phy_enable(struct sas_phy *phy, int enabled); 622 int sas_phy_reset(struct sas_phy *phy, int hard_reset); 623 int sas_queue_up(struct sas_task *task); 624 + extern int sas_queuecommand(struct Scsi_Host * ,struct scsi_cmnd *); 625 extern int sas_target_alloc(struct scsi_target *); 626 extern int sas_slave_alloc(struct scsi_device *); 627 extern int sas_slave_configure(struct scsi_device *);
+21 -2
include/scsi/scsi_host.h
··· 127 * 128 * STATUS: REQUIRED 129 */ 130 - int (* queuecommand)(struct scsi_cmnd *, 131 - void (*done)(struct scsi_cmnd *)); 132 133 /* 134 * The transfer functions are used to queue a scsi command to ··· 504 }; 505 506 /* 507 * shost state: If you alter this, you also need to alter scsi_sysfs.c 508 * (for the ascii descriptions) and the state model enforcer: 509 * scsi_host_set_state() ··· 770 extern void scsi_host_put(struct Scsi_Host *t); 771 extern struct Scsi_Host *scsi_host_lookup(unsigned short); 772 extern const char *scsi_host_state_name(enum scsi_host_state); 773 774 extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); 775
··· 127 * 128 * STATUS: REQUIRED 129 */ 130 + int (* queuecommand)(struct Scsi_Host *, struct scsi_cmnd *); 131 132 /* 133 * The transfer functions are used to queue a scsi command to ··· 505 }; 506 507 /* 508 + * Temporary #define for host lock push down. Can be removed when all 509 + * drivers have been updated to take advantage of unlocked 510 + * queuecommand. 511 + * 512 + */ 513 + #define DEF_SCSI_QCMD(func_name) \ 514 + int func_name(struct Scsi_Host *shost, struct scsi_cmnd *cmd) \ 515 + { \ 516 + unsigned long irq_flags; \ 517 + int rc; \ 518 + spin_lock_irqsave(shost->host_lock, irq_flags); \ 519 + scsi_cmd_get_serial(shost, cmd); \ 520 + rc = func_name##_lck (cmd, cmd->scsi_done); \ 521 + spin_unlock_irqrestore(shost->host_lock, irq_flags); \ 522 + return rc; \ 523 + } 524 + 525 + 526 + /* 527 * shost state: If you alter this, you also need to alter scsi_sysfs.c 528 * (for the ascii descriptions) and the state model enforcer: 529 * scsi_host_set_state() ··· 752 extern void scsi_host_put(struct Scsi_Host *t); 753 extern struct Scsi_Host *scsi_host_lookup(unsigned short); 754 extern const char *scsi_host_state_name(enum scsi_host_state); 755 + extern void scsi_cmd_get_serial(struct Scsi_Host *, struct scsi_cmnd *); 756 757 extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); 758