scsi: Scsi_Cmnd convertion in arm subtree
Subsystems (2)
PATCH 1/1 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 <[email protected]>
---
acornscsi.c | 48 +++++++++++++++++++++++++----------------------- acornscsi.h | 4 ++-- fas216.c | 50 +++++++++++++++++++++++++++----------------------- fas216.h | 36 +++++++++++++++++++----------------- queue.c | 37 +++++++++++++++++++------------------ queue.h | 28 +++++++++++++++------------- scsi.h | 2 +- 7 files changed, 108 insertions(+), 97 deletions(-)
drivers/scsi/arm/acornscsi.c +25 -23
@@ -194,7 +194,8 @@ #define STATUS_BUFFER_TO_PRINT 24unsigned int sdtr_period =SDTR_PERIOD ;unsigned int sdtr_size =SDTR_SIZE ; -static void acornscsi_done (AS_Host *host,Scsi_Cmnd **SCpntp,unsigned int result); +static void acornscsi_done (AS_Host *host,struct scsi_cmnd **SCpntp, +unsigned int result);static int acornscsi_reconnect_finish (AS_Host *host);static void acornscsi_dma_cleanup (AS_Host *host);static void acornscsi_abortcmd (AS_Host *host,unsigned char tag);
@@ -712,7 +713,7 @@ staticintr_ret_t acornscsi_kick (AS_Host *host) {int from_queue =0 ; -Scsi_Cmnd *SCpnt; +struct scsi_cmnd *SCpnt;/* first check to see if a command is waiting to be executed */ SCpnt = host->origSCpnt;
@@ -796,15 +797,15 @@ #endif }/* -* Function: void acornscsi_done(AS_Host *host, Scsi_Cmnd **SCpntp, unsigned int result) +* Function: void acornscsi_done(AS_Host *host, struct scsi_cmnd **SCpntp, unsigned int result) * Purpose : complete processing for command * Params : host - interface that completed * result - driver byte of result */ -static -void acornscsi_done (AS_Host *host,Scsi_Cmnd **SCpntp,unsigned int result) +static void acornscsi_done (AS_Host *host,struct scsi_cmnd **SCpntp, +unsigned int result) { -Scsi_Cmnd *SCpnt = *SCpntp; +struct scsi_cmnd *SCpnt = *SCpntp;/* clean up */ sbic_arm_write (host->scsi.io_port,SBIC_SOURCEID ,SOURCEID_ER |SOURCEID_DSP );
@@ -1318,7 +1319,7 @@ acornscsi_write_pio(AS_Host *host, charstatic void acornscsi_sendcommand (AS_Host *host) { -Scsi_Cmnd *SCpnt = host->SCpnt; +struct scsi_cmnd *SCpnt = host->SCpnt;sbic_arm_write (host->scsi.io_port,SBIC_TRANSCNTH ,0 );sbic_arm_writenext (host->scsi.io_port,0 );
@@ -1693,7 +1694,7 @@ #endifacornscsi_sbic_issuecmd (host,CMND_ASSERTATN );msgqueue_addmsg (&host->scsi.msgs,1 ,ABORT ); }else { -Scsi_Cmnd *SCpnt = host->SCpnt; +struct scsi_cmnd *SCpnt = host->SCpnt;acornscsi_dma_cleanup (host);
@@ -2509,13 +2510,14 @@ acornscsi_intr(int irq, void *dev_id, st*/ /* -* Function : acornscsi_queuecmd(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) +* Function : acornscsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) * Purpose : queues a SCSI command * Params : cmd - SCSI command * done - function called on completion, with pointer to command descriptor * Returns : 0, or < 0 on error. */ -int acornscsi_queuecmd (Scsi_Cmnd *SCpnt,void (*done)(Scsi_Cmnd *)) +int acornscsi_queuecmd (struct scsi_cmnd *SCpnt, +void (*done)(struct scsi_cmnd *)) {AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata;
@@ -2565,17 +2567,18 @@ #endif }/* -* Prototype: void acornscsi_reportstatus(Scsi_Cmnd **SCpntp1, Scsi_Cmnd **SCpntp2, int result) +* Prototype: void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1, struct scsi_cmnd **SCpntp2, int result) * Purpose : pass a result to *SCpntp1, and check if *SCpntp1 = *SCpntp2 * Params : SCpntp1 - pointer to command to return * SCpntp2 - pointer to command to check * result - result to pass back to mid-level done function * Returns : *SCpntp2 = NULL if *SCpntp1 is the same command structure as *SCpntp2. */ -static inline -void acornscsi_reportstatus (Scsi_Cmnd **SCpntp1,Scsi_Cmnd **SCpntp2,int result) +static inline void acornscsi_reportstatus (struct scsi_cmnd **SCpntp1, +struct scsi_cmnd **SCpntp2, +int result) { -Scsi_Cmnd *SCpnt = *SCpntp1; +struct scsi_cmnd *SCpnt = *SCpntp1;if (SCpnt) { *SCpntp1 =NULL ;
@@ -2591,13 +2594,12 @@ void acornscsi_reportstatus(Scsi_Cmnd **enum res_abort { res_not_running, res_success, res_success_clear, res_snooze };/* -* Prototype: enum res acornscsi_do_abort(Scsi_Cmnd *SCpnt) +* Prototype: enum res acornscsi_do_abort(struct scsi_cmnd *SCpnt) * Purpose : abort a command on this host * Params : SCpnt - command to abort * Returns : our abort status */ -static enum res_abort -acornscsi_do_abort (AS_Host *host,Scsi_Cmnd *SCpnt) +static enum res_abort acornscsi_do_abort (AS_Host *host,struct scsi_cmnd *SCpnt) {enum res_abort res = res_not_running;
@@ -2684,12 +2686,12 @@ acornscsi_do_abort(AS_Host *host, Scsi_C }/* -* Prototype: int acornscsi_abort(Scsi_Cmnd *SCpnt) +* Prototype: int acornscsi_abort(struct scsi_cmnd *SCpnt) * Purpose : abort a command on this host * Params : SCpnt - command to abort * Returns : one of SCSI_ABORT_ macros */ -int acornscsi_abort (Scsi_Cmnd *SCpnt) +int acornscsi_abort (struct scsi_cmnd *SCpnt) {AS_Host *host = (AS_Host *) SCpnt->device->host->hostdata;int result;
@@ -2770,16 +2772,16 @@ #endif }/* -* Prototype: int acornscsi_reset(Scsi_Cmnd *SCpnt, unsigned int reset_flags) +* Prototype: int acornscsi_reset(struct scsi_cmnd *SCpnt, unsigned int reset_flags) * Purpose : reset a command on this host/reset this host * Params : SCpnt - command causing reset * result - what type of reset to perform * Returns : one of SCSI_RESET_ macros */ -int acornscsi_reset (Scsi_Cmnd *SCpnt,unsigned int reset_flags) +int acornscsi_reset (struct scsi_cmnd *SCpnt,unsigned int reset_flags) { -AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; -Scsi_Cmnd *SCptr; +AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; +struct scsi_cmnd *SCptr; host->stats.resets +=1 ;
drivers/scsi/arm/acornscsi.h +2 -2
@@ -277,8 +277,8 @@ ({ \ typedef struct acornscsi_hostdata { /* miscellaneous */ struct Scsi_Host *host; /* host */ - Scsi_Cmnd *SCpnt; /* currently processing command */ - Scsi_Cmnd *origSCpnt; /* original connecting command */ + struct scsi_cmnd *SCpnt; /* currently processing command */ + struct scsi_cmnd *origSCpnt; /* original connecting command */ /* driver information */ struct {
drivers/scsi/arm/fas216.c +27 -23
164 lines not on this page · raw message
drivers/scsi/arm/fas216.h +19 -17
@@ -218,11 +218,11 @@ typedef struct {unsigned long magic_start;spinlock_t host_lock;struct Scsi_Host *host;/* host */ -Scsi_Cmnd *SCpnt;/* currently processing command */ -Scsi_Cmnd *origSCpnt;/* original connecting command */ -Scsi_Cmnd *reqSCpnt;/* request sense command */ -Scsi_Cmnd *rstSCpnt;/* reset command */ -Scsi_Cmnd *pending_SCpnt[8 ];/* per-device pending commands */ +struct scsi_cmnd *SCpnt;/* currently processing command */ +struct scsi_cmnd *origSCpnt;/* original connecting command */ +struct scsi_cmnd *reqSCpnt;/* request sense command */ +struct scsi_cmnd *rstSCpnt;/* reset command */ +struct scsi_cmnd *pending_SCpnt[8 ];/* per-device pending commands */ int next_pending;/* next pending device */ /*
@@ -328,21 +328,23 @@ extern int fas216_init (struct Scsi_Host*/ extern int fas216_add (struct Scsi_Host *instance,struct device *dev); -/* Function: int fas216_queue_command (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) +/* Function: int fas216_queue_command(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) * Purpose : queue a command for adapter to process. * Params : SCpnt - Command to queue * done - done function to call once command is complete * Returns : 0 - success, else error */ -extern int fas216_queue_command (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +extern int fas216_queue_command (struct scsi_cmnd *, +void (*done)(struct scsi_cmnd *)); -/* Function: int fas216_noqueue_command (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) +/* Function: int fas216_noqueue_command(istruct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) * Purpose : queue a command for adapter to process, and process it to completion. * Params : SCpnt - Command to queue * done - done function to call once command is complete * Returns : 0 - success, else error */ -extern int fas216_noqueue_command (Scsi_Cmnd *,void (*done)(Scsi_Cmnd *)); +extern int fas216_noqueue_command (struct scsi_cmnd *, +void (*done)(struct scsi_cmnd *));/* Function: irqreturn_t fas216_intr (FAS216_Info *info) * Purpose : handle interrupts from the interface to progress a command
@@ -363,32 +365,32 @@ extern int fas216_print_host(FAS216_Infoextern int fas216_print_stats (FAS216_Info *info,char *buffer);extern int fas216_print_devices (FAS216_Info *info,char *buffer); -/* Function: int fas216_eh_abort(Scsi_Cmnd *SCpnt) +/* Function: int fas216_eh_abort(struct scsi_cmnd *SCpnt) * Purpose : abort this command * Params : SCpnt - command to abort * Returns : FAILED if unable to abort */ -extern int fas216_eh_abort (Scsi_Cmnd *SCpnt); +extern int fas216_eh_abort (struct scsi_cmnd *SCpnt); -/* Function: int fas216_eh_device_reset(Scsi_Cmnd *SCpnt) +/* Function: int fas216_eh_device_reset(struct scsi_cmnd *SCpnt) * Purpose : Reset the device associated with this command * Params : SCpnt - command specifing device to reset * Returns : FAILED if unable to reset */ -extern int fas216_eh_device_reset (Scsi_Cmnd *SCpnt); +extern int fas216_eh_device_reset (struct scsi_cmnd *SCpnt); -/* Function: int fas216_eh_bus_reset(Scsi_Cmnd *SCpnt) +/* Function: int fas216_eh_bus_reset(struct scsi_cmnd *SCpnt) * Purpose : Reset the complete bus associated with this command * Params : SCpnt - command specifing bus to reset * Returns : FAILED if unable to reset */ -extern int fas216_eh_bus_reset (Scsi_Cmnd *SCpnt); +extern int fas216_eh_bus_reset (struct scsi_cmnd *SCpnt); -/* Function: int fas216_eh_host_reset(Scsi_Cmnd *SCpnt) +/* Function: int fas216_eh_host_reset(struct scsi_cmnd *SCpnt) * Purpose : Reset the host associated with this command * Params : SCpnt - command specifing host to reset * Returns : FAILED if unable to reset */ -extern int fas216_eh_host_reset (Scsi_Cmnd *SCpnt); +extern int fas216_eh_host_reset (struct scsi_cmnd *SCpnt);#endif /* FAS216_H */
drivers/scsi/arm/queue.c +19 -18
@@ -29,7 +29,7 @@ #define DEBUG typedef struct queue_entry { struct list_head list; - Scsi_Cmnd *SCpnt; + struct scsi_cmnd *SCpnt; #ifdef DEBUG unsigned long magic; #endif
@@ -96,14 +96,14 @@ void queue_free (Queue_t *queue)/* -* Function: int queue_add_cmd(Queue_t *queue, Scsi_Cmnd *SCpnt, int head) +* Function: int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head) * Purpose : Add a new command onto a queue, adding REQUEST_SENSE to head. * Params : queue - destination queue * SCpnt - command to add * head - add command to head of queue * Returns : 0 on error, !0 on success */ -int __queue_add (Queue_t *queue,Scsi_Cmnd *SCpnt,int head) +int __queue_add (Queue_t *queue,struct scsi_cmnd *SCpnt,int head) {unsigned long flags;struct list_head *l;
@@ -134,7 +134,7 @@ empty:return ret; } -static Scsi_Cmnd *__queue_remove (Queue_t *queue,struct list_head *ent) +static struct scsi_cmnd *__queue_remove (Queue_t *queue,struct list_head *ent) {QE_t *q;
@@ -152,17 +152,17 @@ static Scsi_Cmnd *__queue_remove(Queue_t }/* -* Function: Scsi_Cmnd *queue_remove_exclude (queue, exclude) +* Function: struct scsi_cmnd *queue_remove_exclude (queue, exclude) * Purpose : remove a SCSI command from a queue * Params : queue - queue to remove command from * exclude - bit array of target&lun which is busy -* Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available +* Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available */ -Scsi_Cmnd *queue_remove_exclude (Queue_t *queue,unsigned long *exclude) +struct scsi_cmnd *queue_remove_exclude (Queue_t *queue,unsigned long *exclude) {unsigned long flags;struct list_head *l; -Scsi_Cmnd *SCpnt =NULL ; +struct scsi_cmnd *SCpnt =NULL ;spin_lock_irqsave (&queue->queue_lock, flags);list_for_each (l, &queue->head) {
@@ -178,15 +178,15 @@ Scsi_Cmnd *queue_remove_exclude(Queue_t }/* -* Function: Scsi_Cmnd *queue_remove (queue) +* Function: struct scsi_cmnd *queue_remove (queue) * Purpose : removes first SCSI command from a queue * Params : queue - queue to remove command from -* Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available +* Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available */ -Scsi_Cmnd *queue_remove (Queue_t *queue) +struct scsi_cmnd *queue_remove (Queue_t *queue) {unsigned long flags; -Scsi_Cmnd *SCpnt =NULL ; +struct scsi_cmnd *SCpnt =NULL ;spin_lock_irqsave (&queue->queue_lock, flags);if (!list_empty (&queue->head))
@@ -197,19 +197,20 @@ Scsi_Cmnd *queue_remove(Queue_t *queue) }/* -* Function: Scsi_Cmnd *queue_remove_tgtluntag (queue, target, lun, tag) +* Function: struct scsi_cmnd *queue_remove_tgtluntag (queue, target, lun, tag) * Purpose : remove a SCSI command from the queue for a specified target/lun/tag * Params : queue - queue to remove command from * target - target that we want * lun - lun on device * tag - tag on device -* Returns : Scsi_Cmnd if successful, or NULL if no command satisfies requirements +* Returns : struct scsi_cmnd if successful, or NULL if no command satisfies requirements */ -Scsi_Cmnd *queue_remove_tgtluntag (Queue_t *queue,int target,int lun,int tag) +struct scsi_cmnd *queue_remove_tgtluntag (Queue_t *queue,int target,int lun, +int tag) {unsigned long flags;struct list_head *l; -Scsi_Cmnd *SCpnt =NULL ; +struct scsi_cmnd *SCpnt =NULL ;spin_lock_irqsave (&queue->queue_lock, flags);list_for_each (l, &queue->head) {
@@ -275,13 +276,13 @@ int queue_probetgtlun (Queue_t *queue, i }/* -* Function: int queue_remove_cmd(Queue_t *queue, Scsi_Cmnd *SCpnt) +* Function: int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt) * Purpose : remove a specific command from the queues * Params : queue - queue to look in * SCpnt - command to find * Returns : 0 if not found */ -int queue_remove_cmd (Queue_t *queue,Scsi_Cmnd *SCpnt) +int queue_remove_cmd (Queue_t *queue,struct scsi_cmnd *SCpnt) {unsigned long flags;struct list_head *l;
drivers/scsi/arm/queue.h +15 -13
@@ -32,46 +32,48 @@ extern int queue_initialise (Queue_t *quextern void queue_free (Queue_t *queue);/* -* Function: Scsi_Cmnd *queue_remove (queue) +* Function: struct scsi_cmnd *queue_remove (queue) * Purpose : removes first SCSI command from a queue * Params : queue - queue to remove command from -* Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available +* Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available */ -extern Scsi_Cmnd *queue_remove (Queue_t *queue); +extern struct scsi_cmnd *queue_remove (Queue_t *queue);/* -* Function: Scsi_Cmnd *queue_remove_exclude_ref (queue, exclude) +* Function: struct scsi_cmnd *queue_remove_exclude_ref (queue, exclude) * Purpose : remove a SCSI command from a queue * Params : queue - queue to remove command from * exclude - array of busy LUNs -* Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available +* Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available */ -extern Scsi_Cmnd *queue_remove_exclude (Queue_t *queue,unsigned long *exclude); +extern struct scsi_cmnd *queue_remove_exclude (Queue_t *queue, +unsigned long *exclude);#define queue_add_cmd_ordered (queue,SCpnt) \ __queue_add(queue,SCpnt,(SCpnt)->cmnd[0] == REQUEST_SENSE)#define queue_add_cmd_tail (queue,SCpnt) \ __queue_add(queue,SCpnt,0)/* -* Function: int __queue_add(Queue_t *queue, Scsi_Cmnd *SCpnt, int head) +* Function: int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head) * Purpose : Add a new command onto a queue * Params : queue - destination queue * SCpnt - command to add * head - add command to head of queue * Returns : 0 on error, !0 on success */ -extern int __queue_add (Queue_t *queue,Scsi_Cmnd *SCpnt,int head); +extern int __queue_add (Queue_t *queue,struct scsi_cmnd *SCpnt,int head);/* -* Function: Scsi_Cmnd *queue_remove_tgtluntag (queue, target, lun, tag) +* Function: struct scsi_cmnd *queue_remove_tgtluntag (queue, target, lun, tag) * Purpose : remove a SCSI command from the queue for a specified target/lun/tag * Params : queue - queue to remove command from * target - target that we want * lun - lun on device * tag - tag on device -* Returns : Scsi_Cmnd if successful, or NULL if no command satisfies requirements +* Returns : struct scsi_cmnd if successful, or NULL if no command satisfies requirements */ -extern Scsi_Cmnd *queue_remove_tgtluntag (Queue_t *queue,int target,int lun,int tag); +extern struct scsi_cmnd *queue_remove_tgtluntag (Queue_t *queue,int target, +int lun,int tag);/* * Function: queue_remove_all_target(queue, target)
@@ -94,12 +96,12 @@ extern void queue_remove_all_target(Queuextern int queue_probetgtlun (Queue_t *queue,int target,int lun);/* -* Function: int queue_remove_cmd (Queue_t *queue, Scsi_Cmnd *SCpnt) +* Function: int queue_remove_cmd (Queue_t *queue, struct scsi_cmnd *SCpnt) * Purpose : remove a specific command from the queues * Params : queue - queue to look in * SCpnt - command to find * Returns : 0 if not found */ -int queue_remove_cmd (Queue_t *queue,Scsi_Cmnd *SCpnt); +int queue_remove_cmd (Queue_t *queue,struct scsi_cmnd *SCpnt);#endif /* QUEUE_H */
drivers/scsi/arm/scsi.h +1 -1
@@ -66,7 +66,7 @@ static inline void put_next_SCp_byte(str SCp->this_residual -=1 ; } -static inline void init_SCp (Scsi_Cmnd *SCpnt) +static inline void init_SCp (struct scsi_cmnd *SCpnt) {memset (&SCpnt->SCp,0 ,sizeof (struct scsi_pointer ));