[SCSI] scsi: Scsi_Cmnd convertion in arm subtree

Changes the obsolete Scsi_Cmnd to struct scsi_cmnd in the arm subdir
of the scsi-subsys.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
Acked-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by Henne and committed by James Bottomley ee0ca6ba 1516b55d

+108 -97
+25 -23
drivers/scsi/arm/acornscsi.c
··· 194 unsigned int sdtr_period = SDTR_PERIOD; 195 unsigned int sdtr_size = SDTR_SIZE; 196 197 - static void acornscsi_done(AS_Host *host, Scsi_Cmnd **SCpntp, unsigned int result); 198 static int acornscsi_reconnect_finish(AS_Host *host); 199 static void acornscsi_dma_cleanup(AS_Host *host); 200 static void acornscsi_abortcmd(AS_Host *host, unsigned char tag); ··· 713 intr_ret_t acornscsi_kick(AS_Host *host) 714 { 715 int from_queue = 0; 716 - Scsi_Cmnd *SCpnt; 717 718 /* first check to see if a command is waiting to be executed */ 719 SCpnt = host->origSCpnt; ··· 797 } 798 799 /* 800 - * Function: void acornscsi_done(AS_Host *host, Scsi_Cmnd **SCpntp, unsigned int result) 801 * Purpose : complete processing for command 802 * Params : host - interface that completed 803 * result - driver byte of result 804 */ 805 - static 806 - void acornscsi_done(AS_Host *host, Scsi_Cmnd **SCpntp, unsigned int result) 807 { 808 - Scsi_Cmnd *SCpnt = *SCpntp; 809 810 /* clean up */ 811 sbic_arm_write(host->scsi.io_port, SBIC_SOURCEID, SOURCEID_ER | SOURCEID_DSP); ··· 1319 static void 1320 acornscsi_sendcommand(AS_Host *host) 1321 { 1322 - Scsi_Cmnd *SCpnt = host->SCpnt; 1323 1324 sbic_arm_write(host->scsi.io_port, SBIC_TRANSCNTH, 0); 1325 sbic_arm_writenext(host->scsi.io_port, 0); ··· 1694 acornscsi_sbic_issuecmd(host, CMND_ASSERTATN); 1695 msgqueue_addmsg(&host->scsi.msgs, 1, ABORT); 1696 } else { 1697 - Scsi_Cmnd *SCpnt = host->SCpnt; 1698 1699 acornscsi_dma_cleanup(host); 1700 ··· 2510 */ 2511 2512 /* 2513 - * Function : acornscsi_queuecmd(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) 2514 * Purpose : queues a SCSI command 2515 * Params : cmd - SCSI command 2516 * done - function called on completion, with pointer to command descriptor 2517 * Returns : 0, or < 0 on error. 2518 */ 2519 - int acornscsi_queuecmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 2520 { 2521 AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; 2522 ··· 2567 } 2568 2569 /* 2570 - * Prototype: void acornscsi_reportstatus(Scsi_Cmnd **SCpntp1, Scsi_Cmnd **SCpntp2, int result) 2571 * Purpose : pass a result to *SCpntp1, and check if *SCpntp1 = *SCpntp2 2572 * Params : SCpntp1 - pointer to command to return 2573 * SCpntp2 - pointer to command to check 2574 * result - result to pass back to mid-level done function 2575 * Returns : *SCpntp2 = NULL if *SCpntp1 is the same command structure as *SCpntp2. 2576 */ 2577 - static inline 2578 - void acornscsi_reportstatus(Scsi_Cmnd **SCpntp1, Scsi_Cmnd **SCpntp2, int result) 2579 { 2580 - Scsi_Cmnd *SCpnt = *SCpntp1; 2581 2582 if (SCpnt) { 2583 *SCpntp1 = NULL; ··· 2594 enum res_abort { res_not_running, res_success, res_success_clear, res_snooze }; 2595 2596 /* 2597 - * Prototype: enum res acornscsi_do_abort(Scsi_Cmnd *SCpnt) 2598 * Purpose : abort a command on this host 2599 * Params : SCpnt - command to abort 2600 * Returns : our abort status 2601 */ 2602 - static enum res_abort 2603 - acornscsi_do_abort(AS_Host *host, Scsi_Cmnd *SCpnt) 2604 { 2605 enum res_abort res = res_not_running; 2606 ··· 2686 } 2687 2688 /* 2689 - * Prototype: int acornscsi_abort(Scsi_Cmnd *SCpnt) 2690 * Purpose : abort a command on this host 2691 * Params : SCpnt - command to abort 2692 * Returns : one of SCSI_ABORT_ macros 2693 */ 2694 - int acornscsi_abort(Scsi_Cmnd *SCpnt) 2695 { 2696 AS_Host *host = (AS_Host *) SCpnt->device->host->hostdata; 2697 int result; ··· 2772 } 2773 2774 /* 2775 - * Prototype: int acornscsi_reset(Scsi_Cmnd *SCpnt, unsigned int reset_flags) 2776 * Purpose : reset a command on this host/reset this host 2777 * Params : SCpnt - command causing reset 2778 * result - what type of reset to perform 2779 * Returns : one of SCSI_RESET_ macros 2780 */ 2781 - int acornscsi_reset(Scsi_Cmnd *SCpnt, unsigned int reset_flags) 2782 { 2783 - AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; 2784 - Scsi_Cmnd *SCptr; 2785 2786 host->stats.resets += 1; 2787
··· 194 unsigned int sdtr_period = SDTR_PERIOD; 195 unsigned int sdtr_size = SDTR_SIZE; 196 197 + static void acornscsi_done(AS_Host *host, struct scsi_cmnd **SCpntp, 198 + unsigned int result); 199 static int acornscsi_reconnect_finish(AS_Host *host); 200 static void acornscsi_dma_cleanup(AS_Host *host); 201 static void acornscsi_abortcmd(AS_Host *host, unsigned char tag); ··· 712 intr_ret_t acornscsi_kick(AS_Host *host) 713 { 714 int from_queue = 0; 715 + struct scsi_cmnd *SCpnt; 716 717 /* first check to see if a command is waiting to be executed */ 718 SCpnt = host->origSCpnt; ··· 796 } 797 798 /* 799 + * Function: void acornscsi_done(AS_Host *host, struct scsi_cmnd **SCpntp, unsigned int result) 800 * Purpose : complete processing for command 801 * Params : host - interface that completed 802 * result - driver byte of result 803 */ 804 + static void acornscsi_done(AS_Host *host, struct scsi_cmnd **SCpntp, 805 + unsigned int result) 806 { 807 + struct scsi_cmnd *SCpnt = *SCpntp; 808 809 /* clean up */ 810 sbic_arm_write(host->scsi.io_port, SBIC_SOURCEID, SOURCEID_ER | SOURCEID_DSP); ··· 1318 static void 1319 acornscsi_sendcommand(AS_Host *host) 1320 { 1321 + struct scsi_cmnd *SCpnt = host->SCpnt; 1322 1323 sbic_arm_write(host->scsi.io_port, SBIC_TRANSCNTH, 0); 1324 sbic_arm_writenext(host->scsi.io_port, 0); ··· 1693 acornscsi_sbic_issuecmd(host, CMND_ASSERTATN); 1694 msgqueue_addmsg(&host->scsi.msgs, 1, ABORT); 1695 } else { 1696 + struct scsi_cmnd *SCpnt = host->SCpnt; 1697 1698 acornscsi_dma_cleanup(host); 1699 ··· 2509 */ 2510 2511 /* 2512 + * Function : acornscsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 2513 * Purpose : queues a SCSI command 2514 * Params : cmd - SCSI command 2515 * done - function called on completion, with pointer to command descriptor 2516 * Returns : 0, or < 0 on error. 2517 */ 2518 + int acornscsi_queuecmd(struct scsi_cmnd *SCpnt, 2519 + void (*done)(struct scsi_cmnd *)) 2520 { 2521 AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; 2522 ··· 2565 } 2566 2567 /* 2568 + * Prototype: void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1, struct scsi_cmnd **SCpntp2, int result) 2569 * Purpose : pass a result to *SCpntp1, and check if *SCpntp1 = *SCpntp2 2570 * Params : SCpntp1 - pointer to command to return 2571 * SCpntp2 - pointer to command to check 2572 * result - result to pass back to mid-level done function 2573 * Returns : *SCpntp2 = NULL if *SCpntp1 is the same command structure as *SCpntp2. 2574 */ 2575 + static inline void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1, 2576 + struct scsi_cmnd **SCpntp2, 2577 + int result) 2578 { 2579 + struct scsi_cmnd *SCpnt = *SCpntp1; 2580 2581 if (SCpnt) { 2582 *SCpntp1 = NULL; ··· 2591 enum res_abort { res_not_running, res_success, res_success_clear, res_snooze }; 2592 2593 /* 2594 + * Prototype: enum res acornscsi_do_abort(struct scsi_cmnd *SCpnt) 2595 * Purpose : abort a command on this host 2596 * Params : SCpnt - command to abort 2597 * Returns : our abort status 2598 */ 2599 + static enum res_abort acornscsi_do_abort(AS_Host *host, struct scsi_cmnd *SCpnt) 2600 { 2601 enum res_abort res = res_not_running; 2602 ··· 2684 } 2685 2686 /* 2687 + * Prototype: int acornscsi_abort(struct scsi_cmnd *SCpnt) 2688 * Purpose : abort a command on this host 2689 * Params : SCpnt - command to abort 2690 * Returns : one of SCSI_ABORT_ macros 2691 */ 2692 + int acornscsi_abort(struct scsi_cmnd *SCpnt) 2693 { 2694 AS_Host *host = (AS_Host *) SCpnt->device->host->hostdata; 2695 int result; ··· 2770 } 2771 2772 /* 2773 + * Prototype: int acornscsi_reset(struct scsi_cmnd *SCpnt, unsigned int reset_flags) 2774 * Purpose : reset a command on this host/reset this host 2775 * Params : SCpnt - command causing reset 2776 * result - what type of reset to perform 2777 * Returns : one of SCSI_RESET_ macros 2778 */ 2779 + int acornscsi_reset(struct scsi_cmnd *SCpnt, unsigned int reset_flags) 2780 { 2781 + AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; 2782 + struct scsi_cmnd *SCptr; 2783 2784 host->stats.resets += 1; 2785
+2 -2
drivers/scsi/arm/acornscsi.h
··· 277 typedef struct acornscsi_hostdata { 278 /* miscellaneous */ 279 struct Scsi_Host *host; /* host */ 280 - Scsi_Cmnd *SCpnt; /* currently processing command */ 281 - Scsi_Cmnd *origSCpnt; /* original connecting command */ 282 283 /* driver information */ 284 struct {
··· 277 typedef struct acornscsi_hostdata { 278 /* miscellaneous */ 279 struct Scsi_Host *host; /* host */ 280 + struct scsi_cmnd *SCpnt; /* currently processing command */ 281 + struct scsi_cmnd *origSCpnt; /* original connecting command */ 282 283 /* driver information */ 284 struct {
+27 -23
drivers/scsi/arm/fas216.c
··· 297 printk("scsi%d.%c: %s", info->host->host_no, target, buf); 298 } 299 300 - static void 301 - fas216_log_command(FAS216_Info *info, int level, Scsi_Cmnd *SCpnt, char *fmt, ...) 302 { 303 va_list args; 304 ··· 1662 return handled; 1663 } 1664 1665 - static void __fas216_start_command(FAS216_Info *info, Scsi_Cmnd *SCpnt) 1666 { 1667 int tot_msglen; 1668 ··· 1754 return info->device[target].parity_check; 1755 } 1756 1757 - static void fas216_start_command(FAS216_Info *info, Scsi_Cmnd *SCpnt) 1758 { 1759 int disconnect_ok; 1760 ··· 1808 __fas216_start_command(info, SCpnt); 1809 } 1810 1811 - static void fas216_allocate_tag(FAS216_Info *info, Scsi_Cmnd *SCpnt) 1812 { 1813 #ifdef SCSI2_TAG 1814 /* ··· 1842 } 1843 } 1844 1845 - static void fas216_do_bus_device_reset(FAS216_Info *info, Scsi_Cmnd *SCpnt) 1846 { 1847 struct message *msg; 1848 ··· 1891 */ 1892 static void fas216_kick(FAS216_Info *info) 1893 { 1894 - Scsi_Cmnd *SCpnt = NULL; 1895 #define TYPE_OTHER 0 1896 #define TYPE_RESET 1 1897 #define TYPE_QUEUE 2 ··· 1979 /* 1980 * Clean up from issuing a BUS DEVICE RESET message to a device. 1981 */ 1982 - static void 1983 - fas216_devicereset_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result) 1984 { 1985 fas216_log(info, LOG_ERROR, "fas216 device reset complete"); 1986 ··· 1997 * 1998 * Finish processing automatic request sense command 1999 */ 2000 - static void 2001 - fas216_rq_sns_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result) 2002 { 2003 fas216_log_target(info, LOG_CONNECT, SCpnt->device->id, 2004 "request sense complete, result=0x%04x%02x%02x", ··· 2031 * Finish processing of standard command 2032 */ 2033 static void 2034 - fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result) 2035 { 2036 info->stats.fins += 1; 2037 ··· 2143 */ 2144 static void fas216_done(FAS216_Info *info, unsigned int result) 2145 { 2146 - void (*fn)(FAS216_Info *, Scsi_Cmnd *, unsigned int); 2147 - Scsi_Cmnd *SCpnt; 2148 unsigned long flags; 2149 2150 fas216_checkmagic(info); ··· 2183 info->device[SCpnt->device->id].parity_check = 0; 2184 clear_bit(SCpnt->device->id * 8 + SCpnt->device->lun, info->busyluns); 2185 2186 - fn = (void (*)(FAS216_Info *, Scsi_Cmnd *, unsigned int))SCpnt->host_scribble; 2187 fn(info, SCpnt, result); 2188 2189 if (info->scsi.irq != NO_IRQ) { ··· 2208 * Returns: 0 on success, else error. 2209 * Notes: io_request_lock is held, interrupts are disabled. 2210 */ 2211 - int fas216_queue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 2212 { 2213 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2214 int result; ··· 2256 * 2257 * Trigger restart of a waiting thread in fas216_command 2258 */ 2259 - static void fas216_internal_done(Scsi_Cmnd *SCpnt) 2260 { 2261 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2262 ··· 2273 * Returns: scsi result code. 2274 * Notes: io_request_lock is held, interrupts are disabled. 2275 */ 2276 - int fas216_noqueue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 2277 { 2278 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2279 ··· 2353 * Decide how to abort a command. 2354 * Returns: abort status 2355 */ 2356 - static enum res_find fas216_find_command(FAS216_Info *info, Scsi_Cmnd *SCpnt) 2357 { 2358 enum res_find res = res_failed; 2359 ··· 2421 * Returns: FAILED if unable to abort 2422 * Notes: io_request_lock is taken, and irqs are disabled 2423 */ 2424 - int fas216_eh_abort(Scsi_Cmnd *SCpnt) 2425 { 2426 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2427 int result = FAILED; ··· 2478 * Notes: We won't be re-entered, so we'll only have one device 2479 * reset on the go at one time. 2480 */ 2481 - int fas216_eh_device_reset(Scsi_Cmnd *SCpnt) 2482 { 2483 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2484 unsigned long flags; ··· 2559 * Returns: FAILED if unable to reset. 2560 * Notes: Further commands are blocked. 2561 */ 2562 - int fas216_eh_bus_reset(Scsi_Cmnd *SCpnt) 2563 { 2564 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2565 unsigned long flags; ··· 2659 * Returns: FAILED if unable to reset. 2660 * Notes: io_request_lock is taken, and irqs are disabled 2661 */ 2662 - int fas216_eh_host_reset(Scsi_Cmnd *SCpnt) 2663 { 2664 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2665
··· 297 printk("scsi%d.%c: %s", info->host->host_no, target, buf); 298 } 299 300 + static void fas216_log_command(FAS216_Info *info, int level, 301 + struct scsi_cmnd *SCpnt, char *fmt, ...) 302 { 303 va_list args; 304 ··· 1662 return handled; 1663 } 1664 1665 + static void __fas216_start_command(FAS216_Info *info, struct scsi_cmnd *SCpnt) 1666 { 1667 int tot_msglen; 1668 ··· 1754 return info->device[target].parity_check; 1755 } 1756 1757 + static void fas216_start_command(FAS216_Info *info, struct scsi_cmnd *SCpnt) 1758 { 1759 int disconnect_ok; 1760 ··· 1808 __fas216_start_command(info, SCpnt); 1809 } 1810 1811 + static void fas216_allocate_tag(FAS216_Info *info, struct scsi_cmnd *SCpnt) 1812 { 1813 #ifdef SCSI2_TAG 1814 /* ··· 1842 } 1843 } 1844 1845 + static void fas216_do_bus_device_reset(FAS216_Info *info, 1846 + struct scsi_cmnd *SCpnt) 1847 { 1848 struct message *msg; 1849 ··· 1890 */ 1891 static void fas216_kick(FAS216_Info *info) 1892 { 1893 + struct scsi_cmnd *SCpnt = NULL; 1894 #define TYPE_OTHER 0 1895 #define TYPE_RESET 1 1896 #define TYPE_QUEUE 2 ··· 1978 /* 1979 * Clean up from issuing a BUS DEVICE RESET message to a device. 1980 */ 1981 + static void fas216_devicereset_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, 1982 + unsigned int result) 1983 { 1984 fas216_log(info, LOG_ERROR, "fas216 device reset complete"); 1985 ··· 1996 * 1997 * Finish processing automatic request sense command 1998 */ 1999 + static void fas216_rq_sns_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, 2000 + unsigned int result) 2001 { 2002 fas216_log_target(info, LOG_CONNECT, SCpnt->device->id, 2003 "request sense complete, result=0x%04x%02x%02x", ··· 2030 * Finish processing of standard command 2031 */ 2032 static void 2033 + fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result) 2034 { 2035 info->stats.fins += 1; 2036 ··· 2142 */ 2143 static void fas216_done(FAS216_Info *info, unsigned int result) 2144 { 2145 + void (*fn)(FAS216_Info *, struct scsi_cmnd *, unsigned int); 2146 + struct scsi_cmnd *SCpnt; 2147 unsigned long flags; 2148 2149 fas216_checkmagic(info); ··· 2182 info->device[SCpnt->device->id].parity_check = 0; 2183 clear_bit(SCpnt->device->id * 8 + SCpnt->device->lun, info->busyluns); 2184 2185 + fn = (void (*)(FAS216_Info *, struct scsi_cmnd *, unsigned int))SCpnt->host_scribble; 2186 fn(info, SCpnt, result); 2187 2188 if (info->scsi.irq != NO_IRQ) { ··· 2207 * Returns: 0 on success, else error. 2208 * Notes: io_request_lock is held, interrupts are disabled. 2209 */ 2210 + int fas216_queue_command(struct scsi_cmnd *SCpnt, 2211 + void (*done)(struct scsi_cmnd *)) 2212 { 2213 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2214 int result; ··· 2254 * 2255 * Trigger restart of a waiting thread in fas216_command 2256 */ 2257 + static void fas216_internal_done(struct scsi_cmnd *SCpnt) 2258 { 2259 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2260 ··· 2271 * Returns: scsi result code. 2272 * Notes: io_request_lock is held, interrupts are disabled. 2273 */ 2274 + int fas216_noqueue_command(struct scsi_cmnd *SCpnt, 2275 + void (*done)(struct scsi_cmnd *)) 2276 { 2277 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2278 ··· 2350 * Decide how to abort a command. 2351 * Returns: abort status 2352 */ 2353 + static enum res_find fas216_find_command(FAS216_Info *info, 2354 + struct scsi_cmnd *SCpnt) 2355 { 2356 enum res_find res = res_failed; 2357 ··· 2417 * Returns: FAILED if unable to abort 2418 * Notes: io_request_lock is taken, and irqs are disabled 2419 */ 2420 + int fas216_eh_abort(struct scsi_cmnd *SCpnt) 2421 { 2422 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2423 int result = FAILED; ··· 2474 * Notes: We won't be re-entered, so we'll only have one device 2475 * reset on the go at one time. 2476 */ 2477 + int fas216_eh_device_reset(struct scsi_cmnd *SCpnt) 2478 { 2479 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2480 unsigned long flags; ··· 2555 * Returns: FAILED if unable to reset. 2556 * Notes: Further commands are blocked. 2557 */ 2558 + int fas216_eh_bus_reset(struct scsi_cmnd *SCpnt) 2559 { 2560 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2561 unsigned long flags; ··· 2655 * Returns: FAILED if unable to reset. 2656 * Notes: io_request_lock is taken, and irqs are disabled 2657 */ 2658 + int fas216_eh_host_reset(struct scsi_cmnd *SCpnt) 2659 { 2660 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2661
+19 -17
drivers/scsi/arm/fas216.h
··· 218 unsigned long magic_start; 219 spinlock_t host_lock; 220 struct Scsi_Host *host; /* host */ 221 - Scsi_Cmnd *SCpnt; /* currently processing command */ 222 - Scsi_Cmnd *origSCpnt; /* original connecting command */ 223 - Scsi_Cmnd *reqSCpnt; /* request sense command */ 224 - Scsi_Cmnd *rstSCpnt; /* reset command */ 225 - Scsi_Cmnd *pending_SCpnt[8]; /* per-device pending commands */ 226 int next_pending; /* next pending device */ 227 228 /* ··· 328 */ 329 extern int fas216_add (struct Scsi_Host *instance, struct device *dev); 330 331 - /* Function: int fas216_queue_command (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 332 * Purpose : queue a command for adapter to process. 333 * Params : SCpnt - Command to queue 334 * done - done function to call once command is complete 335 * Returns : 0 - success, else error 336 */ 337 - extern int fas216_queue_command (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 338 339 - /* Function: int fas216_noqueue_command (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 340 * Purpose : queue a command for adapter to process, and process it to completion. 341 * Params : SCpnt - Command to queue 342 * done - done function to call once command is complete 343 * Returns : 0 - success, else error 344 */ 345 - extern int fas216_noqueue_command (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 346 347 /* Function: irqreturn_t fas216_intr (FAS216_Info *info) 348 * Purpose : handle interrupts from the interface to progress a command ··· 365 extern int fas216_print_stats(FAS216_Info *info, char *buffer); 366 extern int fas216_print_devices(FAS216_Info *info, char *buffer); 367 368 - /* Function: int fas216_eh_abort(Scsi_Cmnd *SCpnt) 369 * Purpose : abort this command 370 * Params : SCpnt - command to abort 371 * Returns : FAILED if unable to abort 372 */ 373 - extern int fas216_eh_abort(Scsi_Cmnd *SCpnt); 374 375 - /* Function: int fas216_eh_device_reset(Scsi_Cmnd *SCpnt) 376 * Purpose : Reset the device associated with this command 377 * Params : SCpnt - command specifing device to reset 378 * Returns : FAILED if unable to reset 379 */ 380 - extern int fas216_eh_device_reset(Scsi_Cmnd *SCpnt); 381 382 - /* Function: int fas216_eh_bus_reset(Scsi_Cmnd *SCpnt) 383 * Purpose : Reset the complete bus associated with this command 384 * Params : SCpnt - command specifing bus to reset 385 * Returns : FAILED if unable to reset 386 */ 387 - extern int fas216_eh_bus_reset(Scsi_Cmnd *SCpnt); 388 389 - /* Function: int fas216_eh_host_reset(Scsi_Cmnd *SCpnt) 390 * Purpose : Reset the host associated with this command 391 * Params : SCpnt - command specifing host to reset 392 * Returns : FAILED if unable to reset 393 */ 394 - extern int fas216_eh_host_reset(Scsi_Cmnd *SCpnt); 395 396 #endif /* FAS216_H */
··· 218 unsigned long magic_start; 219 spinlock_t host_lock; 220 struct Scsi_Host *host; /* host */ 221 + struct scsi_cmnd *SCpnt; /* currently processing command */ 222 + struct scsi_cmnd *origSCpnt; /* original connecting command */ 223 + struct scsi_cmnd *reqSCpnt; /* request sense command */ 224 + struct scsi_cmnd *rstSCpnt; /* reset command */ 225 + struct scsi_cmnd *pending_SCpnt[8]; /* per-device pending commands */ 226 int next_pending; /* next pending device */ 227 228 /* ··· 328 */ 329 extern int fas216_add (struct Scsi_Host *instance, struct device *dev); 330 331 + /* Function: int fas216_queue_command(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 332 * Purpose : queue a command for adapter to process. 333 * Params : SCpnt - Command to queue 334 * done - done function to call once command is complete 335 * Returns : 0 - success, else error 336 */ 337 + extern int fas216_queue_command(struct scsi_cmnd *, 338 + void (*done)(struct scsi_cmnd *)); 339 340 + /* Function: int fas216_noqueue_command(istruct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 341 * Purpose : queue a command for adapter to process, and process it to completion. 342 * Params : SCpnt - Command to queue 343 * done - done function to call once command is complete 344 * Returns : 0 - success, else error 345 */ 346 + extern int fas216_noqueue_command(struct scsi_cmnd *, 347 + void (*done)(struct scsi_cmnd *)); 348 349 /* Function: irqreturn_t fas216_intr (FAS216_Info *info) 350 * Purpose : handle interrupts from the interface to progress a command ··· 363 extern int fas216_print_stats(FAS216_Info *info, char *buffer); 364 extern int fas216_print_devices(FAS216_Info *info, char *buffer); 365 366 + /* Function: int fas216_eh_abort(struct scsi_cmnd *SCpnt) 367 * Purpose : abort this command 368 * Params : SCpnt - command to abort 369 * Returns : FAILED if unable to abort 370 */ 371 + extern int fas216_eh_abort(struct scsi_cmnd *SCpnt); 372 373 + /* Function: int fas216_eh_device_reset(struct scsi_cmnd *SCpnt) 374 * Purpose : Reset the device associated with this command 375 * Params : SCpnt - command specifing device to reset 376 * Returns : FAILED if unable to reset 377 */ 378 + extern int fas216_eh_device_reset(struct scsi_cmnd *SCpnt); 379 380 + /* Function: int fas216_eh_bus_reset(struct scsi_cmnd *SCpnt) 381 * Purpose : Reset the complete bus associated with this command 382 * Params : SCpnt - command specifing bus to reset 383 * Returns : FAILED if unable to reset 384 */ 385 + extern int fas216_eh_bus_reset(struct scsi_cmnd *SCpnt); 386 387 + /* Function: int fas216_eh_host_reset(struct scsi_cmnd *SCpnt) 388 * Purpose : Reset the host associated with this command 389 * Params : SCpnt - command specifing host to reset 390 * Returns : FAILED if unable to reset 391 */ 392 + extern int fas216_eh_host_reset(struct scsi_cmnd *SCpnt); 393 394 #endif /* FAS216_H */
+19 -18
drivers/scsi/arm/queue.c
··· 29 30 typedef struct queue_entry { 31 struct list_head list; 32 - Scsi_Cmnd *SCpnt; 33 #ifdef DEBUG 34 unsigned long magic; 35 #endif ··· 96 97 98 /* 99 - * Function: int queue_add_cmd(Queue_t *queue, Scsi_Cmnd *SCpnt, int head) 100 * Purpose : Add a new command onto a queue, adding REQUEST_SENSE to head. 101 * Params : queue - destination queue 102 * SCpnt - command to add 103 * head - add command to head of queue 104 * Returns : 0 on error, !0 on success 105 */ 106 - int __queue_add(Queue_t *queue, Scsi_Cmnd *SCpnt, int head) 107 { 108 unsigned long flags; 109 struct list_head *l; ··· 134 return ret; 135 } 136 137 - static Scsi_Cmnd *__queue_remove(Queue_t *queue, struct list_head *ent) 138 { 139 QE_t *q; 140 ··· 152 } 153 154 /* 155 - * Function: Scsi_Cmnd *queue_remove_exclude (queue, exclude) 156 * Purpose : remove a SCSI command from a queue 157 * Params : queue - queue to remove command from 158 * exclude - bit array of target&lun which is busy 159 - * Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available 160 */ 161 - Scsi_Cmnd *queue_remove_exclude(Queue_t *queue, unsigned long *exclude) 162 { 163 unsigned long flags; 164 struct list_head *l; 165 - Scsi_Cmnd *SCpnt = NULL; 166 167 spin_lock_irqsave(&queue->queue_lock, flags); 168 list_for_each(l, &queue->head) { ··· 178 } 179 180 /* 181 - * Function: Scsi_Cmnd *queue_remove (queue) 182 * Purpose : removes first SCSI command from a queue 183 * Params : queue - queue to remove command from 184 - * Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available 185 */ 186 - Scsi_Cmnd *queue_remove(Queue_t *queue) 187 { 188 unsigned long flags; 189 - Scsi_Cmnd *SCpnt = NULL; 190 191 spin_lock_irqsave(&queue->queue_lock, flags); 192 if (!list_empty(&queue->head)) ··· 197 } 198 199 /* 200 - * Function: Scsi_Cmnd *queue_remove_tgtluntag (queue, target, lun, tag) 201 * Purpose : remove a SCSI command from the queue for a specified target/lun/tag 202 * Params : queue - queue to remove command from 203 * target - target that we want 204 * lun - lun on device 205 * tag - tag on device 206 - * Returns : Scsi_Cmnd if successful, or NULL if no command satisfies requirements 207 */ 208 - Scsi_Cmnd *queue_remove_tgtluntag (Queue_t *queue, int target, int lun, int tag) 209 { 210 unsigned long flags; 211 struct list_head *l; 212 - Scsi_Cmnd *SCpnt = NULL; 213 214 spin_lock_irqsave(&queue->queue_lock, flags); 215 list_for_each(l, &queue->head) { ··· 276 } 277 278 /* 279 - * Function: int queue_remove_cmd(Queue_t *queue, Scsi_Cmnd *SCpnt) 280 * Purpose : remove a specific command from the queues 281 * Params : queue - queue to look in 282 * SCpnt - command to find 283 * Returns : 0 if not found 284 */ 285 - int queue_remove_cmd(Queue_t *queue, Scsi_Cmnd *SCpnt) 286 { 287 unsigned long flags; 288 struct list_head *l;
··· 29 30 typedef struct queue_entry { 31 struct list_head list; 32 + struct scsi_cmnd *SCpnt; 33 #ifdef DEBUG 34 unsigned long magic; 35 #endif ··· 96 97 98 /* 99 + * Function: int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head) 100 * Purpose : Add a new command onto a queue, adding REQUEST_SENSE to head. 101 * Params : queue - destination queue 102 * SCpnt - command to add 103 * head - add command to head of queue 104 * Returns : 0 on error, !0 on success 105 */ 106 + int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head) 107 { 108 unsigned long flags; 109 struct list_head *l; ··· 134 return ret; 135 } 136 137 + static struct scsi_cmnd *__queue_remove(Queue_t *queue, struct list_head *ent) 138 { 139 QE_t *q; 140 ··· 152 } 153 154 /* 155 + * Function: struct scsi_cmnd *queue_remove_exclude (queue, exclude) 156 * Purpose : remove a SCSI command from a queue 157 * Params : queue - queue to remove command from 158 * exclude - bit array of target&lun which is busy 159 + * Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available 160 */ 161 + struct scsi_cmnd *queue_remove_exclude(Queue_t *queue, unsigned long *exclude) 162 { 163 unsigned long flags; 164 struct list_head *l; 165 + struct scsi_cmnd *SCpnt = NULL; 166 167 spin_lock_irqsave(&queue->queue_lock, flags); 168 list_for_each(l, &queue->head) { ··· 178 } 179 180 /* 181 + * Function: struct scsi_cmnd *queue_remove (queue) 182 * Purpose : removes first SCSI command from a queue 183 * Params : queue - queue to remove command from 184 + * Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available 185 */ 186 + struct scsi_cmnd *queue_remove(Queue_t *queue) 187 { 188 unsigned long flags; 189 + struct scsi_cmnd *SCpnt = NULL; 190 191 spin_lock_irqsave(&queue->queue_lock, flags); 192 if (!list_empty(&queue->head)) ··· 197 } 198 199 /* 200 + * Function: struct scsi_cmnd *queue_remove_tgtluntag (queue, target, lun, tag) 201 * Purpose : remove a SCSI command from the queue for a specified target/lun/tag 202 * Params : queue - queue to remove command from 203 * target - target that we want 204 * lun - lun on device 205 * tag - tag on device 206 + * Returns : struct scsi_cmnd if successful, or NULL if no command satisfies requirements 207 */ 208 + struct scsi_cmnd *queue_remove_tgtluntag(Queue_t *queue, int target, int lun, 209 + int tag) 210 { 211 unsigned long flags; 212 struct list_head *l; 213 + struct scsi_cmnd *SCpnt = NULL; 214 215 spin_lock_irqsave(&queue->queue_lock, flags); 216 list_for_each(l, &queue->head) { ··· 275 } 276 277 /* 278 + * Function: int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt) 279 * Purpose : remove a specific command from the queues 280 * Params : queue - queue to look in 281 * SCpnt - command to find 282 * Returns : 0 if not found 283 */ 284 + int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt) 285 { 286 unsigned long flags; 287 struct list_head *l;
+15 -13
drivers/scsi/arm/queue.h
··· 32 extern void queue_free (Queue_t *queue); 33 34 /* 35 - * Function: Scsi_Cmnd *queue_remove (queue) 36 * Purpose : removes first SCSI command from a queue 37 * Params : queue - queue to remove command from 38 - * Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available 39 */ 40 - extern Scsi_Cmnd *queue_remove (Queue_t *queue); 41 42 /* 43 - * Function: Scsi_Cmnd *queue_remove_exclude_ref (queue, exclude) 44 * Purpose : remove a SCSI command from a queue 45 * Params : queue - queue to remove command from 46 * exclude - array of busy LUNs 47 - * Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available 48 */ 49 - extern Scsi_Cmnd *queue_remove_exclude (Queue_t *queue, unsigned long *exclude); 50 51 #define queue_add_cmd_ordered(queue,SCpnt) \ 52 __queue_add(queue,SCpnt,(SCpnt)->cmnd[0] == REQUEST_SENSE) 53 #define queue_add_cmd_tail(queue,SCpnt) \ 54 __queue_add(queue,SCpnt,0) 55 /* 56 - * Function: int __queue_add(Queue_t *queue, Scsi_Cmnd *SCpnt, int head) 57 * Purpose : Add a new command onto a queue 58 * Params : queue - destination queue 59 * SCpnt - command to add 60 * head - add command to head of queue 61 * Returns : 0 on error, !0 on success 62 */ 63 - extern int __queue_add(Queue_t *queue, Scsi_Cmnd *SCpnt, int head); 64 65 /* 66 - * Function: Scsi_Cmnd *queue_remove_tgtluntag (queue, target, lun, tag) 67 * Purpose : remove a SCSI command from the queue for a specified target/lun/tag 68 * Params : queue - queue to remove command from 69 * target - target that we want 70 * lun - lun on device 71 * tag - tag on device 72 - * Returns : Scsi_Cmnd if successful, or NULL if no command satisfies requirements 73 */ 74 - extern Scsi_Cmnd *queue_remove_tgtluntag (Queue_t *queue, int target, int lun, int tag); 75 76 /* 77 * Function: queue_remove_all_target(queue, target) ··· 96 extern int queue_probetgtlun (Queue_t *queue, int target, int lun); 97 98 /* 99 - * Function: int queue_remove_cmd (Queue_t *queue, Scsi_Cmnd *SCpnt) 100 * Purpose : remove a specific command from the queues 101 * Params : queue - queue to look in 102 * SCpnt - command to find 103 * Returns : 0 if not found 104 */ 105 - int queue_remove_cmd(Queue_t *queue, Scsi_Cmnd *SCpnt); 106 107 #endif /* QUEUE_H */
··· 32 extern void queue_free (Queue_t *queue); 33 34 /* 35 + * Function: struct scsi_cmnd *queue_remove (queue) 36 * Purpose : removes first SCSI command from a queue 37 * Params : queue - queue to remove command from 38 + * Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available 39 */ 40 + extern struct scsi_cmnd *queue_remove (Queue_t *queue); 41 42 /* 43 + * Function: struct scsi_cmnd *queue_remove_exclude_ref (queue, exclude) 44 * Purpose : remove a SCSI command from a queue 45 * Params : queue - queue to remove command from 46 * exclude - array of busy LUNs 47 + * Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available 48 */ 49 + extern struct scsi_cmnd *queue_remove_exclude(Queue_t *queue, 50 + unsigned long *exclude); 51 52 #define queue_add_cmd_ordered(queue,SCpnt) \ 53 __queue_add(queue,SCpnt,(SCpnt)->cmnd[0] == REQUEST_SENSE) 54 #define queue_add_cmd_tail(queue,SCpnt) \ 55 __queue_add(queue,SCpnt,0) 56 /* 57 + * Function: int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head) 58 * Purpose : Add a new command onto a queue 59 * Params : queue - destination queue 60 * SCpnt - command to add 61 * head - add command to head of queue 62 * Returns : 0 on error, !0 on success 63 */ 64 + extern int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head); 65 66 /* 67 + * Function: struct scsi_cmnd *queue_remove_tgtluntag (queue, target, lun, tag) 68 * Purpose : remove a SCSI command from the queue for a specified target/lun/tag 69 * Params : queue - queue to remove command from 70 * target - target that we want 71 * lun - lun on device 72 * tag - tag on device 73 + * Returns : struct scsi_cmnd if successful, or NULL if no command satisfies requirements 74 */ 75 + extern struct scsi_cmnd *queue_remove_tgtluntag(Queue_t *queue, int target, 76 + int lun, int tag); 77 78 /* 79 * Function: queue_remove_all_target(queue, target) ··· 94 extern int queue_probetgtlun (Queue_t *queue, int target, int lun); 95 96 /* 97 + * Function: int queue_remove_cmd (Queue_t *queue, struct scsi_cmnd *SCpnt) 98 * Purpose : remove a specific command from the queues 99 * Params : queue - queue to look in 100 * SCpnt - command to find 101 * Returns : 0 if not found 102 */ 103 + int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt); 104 105 #endif /* QUEUE_H */
+1 -1
drivers/scsi/arm/scsi.h
··· 66 SCp->this_residual -= 1; 67 } 68 69 - static inline void init_SCp(Scsi_Cmnd *SCpnt) 70 { 71 memset(&SCpnt->SCp, 0, sizeof(struct scsi_pointer)); 72
··· 66 SCp->this_residual -= 1; 67 } 68 69 + static inline void init_SCp(struct scsi_cmnd *SCpnt) 70 { 71 memset(&SCpnt->SCp, 0, sizeof(struct scsi_pointer)); 72