Re: [PATCH 0/33][SCSI] Arrange for removal of 'scsi_typedefs.h'

2008-01-06 Thread Richard Knutsson

James Bottomley wrote:

On Sun, 2008-01-06 at 04:02 +0100, Richard Knutsson wrote:
  

Hi all

drivers/scsi/scsi_typedefs.h is about ready to be removed, only the
'struct scsi_cmnd' typedef Scsi_Cmnd is left.
This set converts all the Scsi_Cmnd's, except in:
Changelogs
Documentation/scsi/scsi_mid_low_api.txt

So if all these gets merged, in one form or the other, we can:
un'include scsi_typedefs.h from drivers/scsi/scsi.h
fix the text in Documentation/scsi/scsi_mid_low_api.txt
(finally) remove the file in question


Left the over 80 characters wide-warnings alone, until requested otherwise.

Am not subscribed on linux-scsi@vger.kernel.org, so if replying, please Cc: me.



Actually, a lot of this is superfluous ... the drivers are already
removed in the scsi-misc-2.6 tree.
  

When are they be expected to be removed in the mainstream?

The ideal is to remove this line:

#include scsi.h

Because that file (and scsi_typedefs.h) should be expendable by the end
of all of this (their whole purpose was so we didn't have to convert all
the typedefs), and then check the thing still compiles---you probably
have to add in some of the standard #include scsi/scsi_.. files.
  

Sounds reasonable.

Please also don't bother with downcasing Scsi_Cmnd  capitalisation in
the comments, that's a quirk I'm happy to leave, since it's unambiguous
in the doc book.
  
Ok, not like it is a real bother  can't imagine this would be a 
possible source for collision with other patches, but I don't mind 
either way.


Thanks
Richard Knutsson

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 32/33][SCSI] wd7000: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.
Cleaned up checkpatch.pl-error.


diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c
index 03cd44f..185e1b5 100644
--- a/drivers/scsi/wd7000.c
+++ b/drivers/scsi/wd7000.c
@@ -1567,7 +1567,7 @@ static int wd7000_release(struct Scsi_Host *shost)
 /*
  *  I have absolutely NO idea how to do an abort with the WD7000...
  */
-static int wd7000_abort(Scsi_Cmnd * SCpnt)
+static int wd7000_abort(struct scsi_cmnd *SCpnt)
 {
Adapter *host = (Adapter *) SCpnt-device-host-hostdata;
 
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 33a/33] include/scsi/scsi_tcq.h: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---


diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h
index cf4c219..341ed5a 100644
--- a/include/scsi/scsi_tcq.h
+++ b/include/scsi/scsi_tcq.h
@@ -86,7 +86,7 @@ static inline void scsi_deactivate_tcq(struct scsi_device 
*sdev, int depth)
 
 /**
  * scsi_populate_tag_msg - place a tag message in a buffer
- * @SCpnt: pointer to the Scsi_Cmnd for the tag
+ * @SCpnt: pointer to the scsi_cmnd for the tag
  * @msg:   pointer to the area to place the tag
  *
  * Notes:
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 33b/33] include/scsi/scsi_tcq.h: Correct the parameter-name

2008-01-05 Thread Richard Knutsson
Change to the correct argument-name.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---


diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h
index cf4c219..341ed5a 100644
--- a/include/scsi/scsi_tcq.h
+++ b/include/scsi/scsi_tcq.h
@@ -86,7 +86,7 @@ static inline void scsi_deactivate_tcq(struct scsi_device 
*sdev, int depth)
 
 /**
  * scsi_populate_tag_msg - place a tag message in a buffer
- * @SCpnt: pointer to the scsi_cmnd for the tag
+ * @cmd:   pointer to the scsi_cmnd for the tag
  * @msg:   pointer to the area to place the tag
  *
  * Notes:
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/33][SCSI] atari_NCR5380: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.
Cleaned up checkpatch.pl-errors (so no ' 80 lines'-warning).


diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c
index a9680b5..8bd1529 100644
--- a/drivers/scsi/atari_NCR5380.c
+++ b/drivers/scsi/atari_NCR5380.c
@@ -272,9 +272,9 @@ static struct scsi_host_template *the_template = NULL;
(struct NCR5380_hostdata *)(in)-hostdata
 #defineHOSTDATA(in) ((struct NCR5380_hostdata *)(in)-hostdata)
 
-#defineNEXT(cmd)   ((Scsi_Cmnd *)(cmd)-host_scribble)
+#defineNEXT(cmd)   ((struct scsi_cmnd 
*)(cmd)-host_scribble)
 #defineSET_NEXT(cmd,next)  ((cmd)-host_scribble = (void *)(next))
-#defineNEXTADDR(cmd)   ((Scsi_Cmnd **)(cmd)-host_scribble)
+#defineNEXTADDR(cmd)   ((struct scsi_cmnd 
**)(cmd)-host_scribble)
 
 #defineHOSTNO  instance-host_no
 #defineH_NO(cmd)   (cmd)-device-host-host_no
@@ -359,7 +359,7 @@ static void __init init_tags(void)
  * conditions.
  */
 
-static int is_lun_busy(Scsi_Cmnd *cmd, int should_be_tagged)
+static int is_lun_busy(struct scsi_cmnd *cmd, int should_be_tagged)
 {
SETUP_HOSTDATA(cmd-device-host);
 
@@ -383,7 +383,7 @@ static int is_lun_busy(Scsi_Cmnd *cmd, int should_be_tagged)
  * untagged.
  */
 
-static void cmd_get_tag(Scsi_Cmnd *cmd, int should_be_tagged)
+static void cmd_get_tag(struct scsi_cmnd *cmd, int should_be_tagged)
 {
SETUP_HOSTDATA(cmd-device-host);
 
@@ -414,7 +414,7 @@ static void cmd_get_tag(Scsi_Cmnd *cmd, int 
should_be_tagged)
  * unlock the LUN.
  */
 
-static void cmd_free_tag(Scsi_Cmnd *cmd)
+static void cmd_free_tag(struct scsi_cmnd *cmd)
 {
SETUP_HOSTDATA(cmd-device-host);
 
@@ -456,18 +456,18 @@ static void free_all_tags(void)
 
 
 /*
- * Function: void merge_contiguous_buffers( Scsi_Cmnd *cmd )
+ * Function: void merge_contiguous_buffers( struct scsi_cmnd *cmd )
  *
  * Purpose: Try to merge several scatter-gather requests into one DMA
  *transfer. This is possible if the scatter buffers lie on
  *physical contiguous addresses.
  *
- * Parameters: Scsi_Cmnd *cmd
+ * Parameters: struct scsi_cmnd *cmd
  *The command to work on. The first scatter buffer's data are
  *assumed to be already transfered into ptr/this_residual.
  */
 
-static void merge_contiguous_buffers(Scsi_Cmnd *cmd)
+static void merge_contiguous_buffers(struct scsi_cmnd *cmd)
 {
unsigned long endaddr;
 #if (NDEBUG  NDEBUG_MERGING)
@@ -496,15 +496,15 @@ static void merge_contiguous_buffers(Scsi_Cmnd *cmd)
 }
 
 /*
- * Function : void initialize_SCp(Scsi_Cmnd *cmd)
+ * Function : void initialize_SCp(struct scsi_cmnd *cmd)
  *
  * Purpose : initialize the saved data pointers for cmd to point to the
  * start of the buffer.
  *
- * Inputs : cmd - Scsi_Cmnd structure to have pointers reset.
+ * Inputs : cmd - scsi_cmnd structure to have pointers reset.
  */
 
-static inline void initialize_SCp(Scsi_Cmnd *cmd)
+static inline void initialize_SCp(struct scsi_cmnd *cmd)
 {
/*
 * Initialize the Scsi Pointer field so that all of the commands in the
@@ -759,14 +759,14 @@ static void NCR5380_print_status(struct Scsi_Host 
*instance)
if (pos + strlen(fmt) + 20 /* slop */  buffer + length)
\
pos += sprintf(pos, fmt , ## args); 
\
} while(0)
-static char *lprint_Scsi_Cmnd(Scsi_Cmnd *cmd, char *pos, char *buffer, int 
length);
+static char *lprint_Scsi_Cmnd(struct scsi_cmnd *cmd, char *pos, char *buffer, 
int length);
 
 static int NCR5380_proc_info(struct Scsi_Host *instance, char *buffer,
 char **start, off_t offset, int length, int inout)
 {
char *pos = buffer;
struct NCR5380_hostdata *hostdata;
-   Scsi_Cmnd *ptr;
+   struct scsi_cmnd *ptr;
unsigned long flags;
off_t begin = 0;
 #define check_offset() \
@@ -790,18 +790,18 @@ static int NCR5380_proc_info(struct Scsi_Host *instance, 
char *buffer,
if (!hostdata-connected)
SPRINTF(scsi%d: no currently connected command\n, HOSTNO);
else
-   pos = lprint_Scsi_Cmnd((Scsi_Cmnd *) hostdata-connected,
+   pos = lprint_Scsi_Cmnd((struct scsi_cmnd *) hostdata-connected,
   pos, buffer, length);
SPRINTF(scsi%d: issue_queue\n, HOSTNO);
check_offset();
-   for (ptr = (Scsi_Cmnd *)hostdata-issue_queue; ptr; ptr = NEXT(ptr)) {
+   for (ptr = (struct scsi_cmnd *)hostdata-issue_queue; ptr; ptr = 
NEXT(ptr)) {
pos = lprint_Scsi_Cmnd(ptr, pos, buffer, length);
check_offset();
}
 
SPRINTF(scsi%d: disconnected_queue\n, HOSTNO);
check_offset

[PATCH 4/33][SCSI] aha1542: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.
Cleaned up checkpatch.pl-errors (so no ' 80 lines'-warning).


diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index bbcc2c5..5e1a17e 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -60,7 +60,7 @@ static void BAD_DMA(void *address, unsigned int length)
panic(Buffer at physical address  16Mb used for aha1542);
 }
 
-static void BAD_SG_DMA(Scsi_Cmnd * SCpnt,
+static void BAD_SG_DMA(struct scsi_cmnd *SCpnt,
   struct scatterlist *sgp,
   int nseg,
   int badseg)
@@ -155,7 +155,7 @@ struct aha1542_hostdata {
int bios_translation;   /* Mapping bios uses - for compatibility */
int aha1542_last_mbi_used;
int aha1542_last_mbo_used;
-   Scsi_Cmnd *SCint[AHA1542_MAILBOXES];
+   struct scsi_cmnd *SCint[AHA1542_MAILBOXES];
struct mailbox mb[2 * AHA1542_MAILBOXES];
struct ccb ccb[AHA1542_MAILBOXES];
 };
@@ -431,11 +431,11 @@ static irqreturn_t do_aha1542_intr_handle(int irq, void 
*dev_id)
 /* A high level interrupt handler */
 static void aha1542_intr_handle(struct Scsi_Host *shost, void *dev_id)
 {
-   void (*my_done) (Scsi_Cmnd *) = NULL;
+   void (*my_done) (struct scsi_cmnd *) = NULL;
int errstatus, mbi, mbo, mbistatus;
int number_serviced;
unsigned long flags;
-   Scsi_Cmnd *SCtmp;
+   struct scsi_cmnd *SCtmp;
int flag;
int needs_restart;
struct mailbox *mb;
@@ -589,7 +589,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost, 
void *dev_id)
};
 }
 
-static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
+static int aha1542_queuecommand(struct scsi_cmnd *SCpnt, void (*done) (struct 
scsi_cmnd *))
 {
unchar ahacmd = CMD_START_SCSI;
unchar direction;
@@ -1339,7 +1339,7 @@ static int aha1542_restart(struct Scsi_Host *shost)
  * This is a device reset.  This is handled by sending a special command
  * to the device.
  */
-static int aha1542_dev_reset(Scsi_Cmnd * SCpnt)
+static int aha1542_dev_reset(struct scsi_cmnd *SCpnt)
 {
unsigned long flags;
struct mailbox *mb;
@@ -1417,7 +1417,7 @@ static int aha1542_dev_reset(Scsi_Cmnd * SCpnt)
for (i = 0; i  AHA1542_MAILBOXES; i++) {
if (HOSTDATA(SCpnt-host)-SCint[i] 
HOSTDATA(SCpnt-host)-SCint[i]-target == SCpnt-target) {
-   Scsi_Cmnd *SCtmp;
+   struct scsi_cmnd *SCtmp;
SCtmp = HOSTDATA(SCpnt-host)-SCint[i];
kfree(SCtmp-host_scribble);
SCtmp-host_scribble = NULL;
@@ -1431,7 +1431,7 @@ static int aha1542_dev_reset(Scsi_Cmnd * SCpnt)
 #endif /* ERIC_neverdef */
 }
 
-static int aha1542_bus_reset(Scsi_Cmnd * SCpnt)
+static int aha1542_bus_reset(struct scsi_cmnd *SCpnt)
 {
int i;
 
@@ -1467,7 +1467,7 @@ static int aha1542_bus_reset(Scsi_Cmnd * SCpnt)
 
for (i = 0; i  AHA1542_MAILBOXES; i++) {
if (HOSTDATA(SCpnt-device-host)-SCint[i] != NULL) {
-   Scsi_Cmnd *SCtmp;
+   struct scsi_cmnd *SCtmp;
SCtmp = HOSTDATA(SCpnt-device-host)-SCint[i];
 
 
@@ -1495,7 +1495,7 @@ fail:
return FAILED;
 }
 
-static int aha1542_host_reset(Scsi_Cmnd * SCpnt)
+static int aha1542_host_reset(struct scsi_cmnd *SCpnt)
 {
int i;
 
@@ -1536,7 +1536,7 @@ static int aha1542_host_reset(Scsi_Cmnd * SCpnt)
 
for (i = 0; i  AHA1542_MAILBOXES; i++) {
if (HOSTDATA(SCpnt-device-host)-SCint[i] != NULL) {
-   Scsi_Cmnd *SCtmp;
+   struct scsi_cmnd *SCtmp;
SCtmp = HOSTDATA(SCpnt-device-host)-SCint[i];
 
if (SCtmp-device-soft_reset) {
@@ -1568,7 +1568,7 @@ fail:
  * These are the old error handling routines.  They are only temporarily
  * here while we play with the new error handling code.
  */
-static int aha1542_old_abort(Scsi_Cmnd * SCpnt)
+static int aha1542_old_abort(struct scsi_cmnd *SCpnt)
 {
 #if 0
unchar ahacmd = CMD_START_SCSI;
@@ -1646,7 +1646,7 @@ static int aha1542_old_abort(Scsi_Cmnd * SCpnt)
For a first go, we assume that the 1542 notifies us with all of the
pending commands (it does implement soft reset, after all). */
 
-static int aha1542_old_reset(Scsi_Cmnd * SCpnt, unsigned int reset_flags)
+static int aha1542_old_reset(struct scsi_cmnd *SCpnt, unsigned int reset_flags)
 {
unchar ahacmd = CMD_START_SCSI;
int i;
@@ -1689,7 +1689,7 @@ static int aha1542_old_reset(Scsi_Cmnd * SCpnt, unsigned 
int reset_flags)
 
for (i = 0; i  AHA1542_MAILBOXES; i++)
if (HOSTDATA(SCpnt-host

[PATCH 2/33][SCSI] advansys: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.


diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 9dd3952..a9a8685 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -10920,7 +10920,7 @@ static int AdvExeScsiQueue(ADV_DVC_VAR *asc_dvc, 
ADV_SCSI_REQ_Q *scsiq)
 }
 
 /*
- * Execute a single 'Scsi_Cmnd'.
+ * Execute a single 'scsi_cmnd'.
  */
 static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp)
 {
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/33][SCSI] Arrange for removal of 'scsi_typedefs.h'

2008-01-05 Thread Richard Knutsson
Hi all

drivers/scsi/scsi_typedefs.h is about ready to be removed, only the
'struct scsi_cmnd' typedef Scsi_Cmnd is left.
This set converts all the Scsi_Cmnd's, except in:
Changelogs
Documentation/scsi/scsi_mid_low_api.txt

So if all these gets merged, in one form or the other, we can:
un'include scsi_typedefs.h from drivers/scsi/scsi.h
fix the text in Documentation/scsi/scsi_mid_low_api.txt
(finally) remove the file in question


Left the over 80 characters wide-warnings alone, until requested otherwise.

Am not subscribed on linux-scsi@vger.kernel.org, so if replying, please Cc: me.

Yours,
Richard Knutsson

PS
If someone know of a tool to chain-mail patches and still be able to customize
the mail-addresses between them, please let me know.
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/33][SCSI] 3w-xxxx: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.


diff --git a/drivers/scsi/3w-.c b/drivers/scsi/3w-.c
index 59716eb..54374e3 100644
--- a/drivers/scsi/3w-.c
+++ b/drivers/scsi/3w-.c
@@ -1955,7 +1955,7 @@ static int tw_scsi_queue(struct scsi_cmnd *SCpnt, void 
(*done)(struct scsi_cmnd
if (test_bit(TW_IN_RESET, tw_dev-flags))
return SCSI_MLQUEUE_HOST_BUSY;
 
-   /* Save done function into Scsi_Cmnd struct */
+   /* Save done function into scsi_cmnd struct */
SCpnt-scsi_done = done;
 
/* Queue the command and get a request id */
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 28/33][SCSI] oktagon_esp: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.
Cleaned up checkpatch.pl-errors.


diff --git a/drivers/scsi/oktagon_esp.c b/drivers/scsi/oktagon_esp.c
index 8e5eadb..9bc4eea 100644
--- a/drivers/scsi/oktagon_esp.c
+++ b/drivers/scsi/oktagon_esp.c
@@ -49,7 +49,7 @@
 
 
 static int  dma_bytes_sent(struct NCR_ESP *esp, int fifo_count);
-static int  dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp);
+static int  dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp);
 static void dma_dump_state(struct NCR_ESP *esp);
 static void dma_init_read(struct NCR_ESP *esp, __u32 vaddress, int length);
 static void dma_init_write(struct NCR_ESP *esp, __u32 vaddress, int length);
@@ -64,11 +64,11 @@ static void dma_setup(struct NCR_ESP *esp, __u32 addr, int 
count, int write);
 static void dma_irq_exit(struct NCR_ESP *esp);
 static void dma_invalidate(struct NCR_ESP *esp);
 
-static void dma_mmu_get_scsi_one(struct NCR_ESP *,Scsi_Cmnd *);
-static void dma_mmu_get_scsi_sgl(struct NCR_ESP *,Scsi_Cmnd *);
-static void dma_mmu_release_scsi_one(struct NCR_ESP *,Scsi_Cmnd *);
-static void dma_mmu_release_scsi_sgl(struct NCR_ESP *,Scsi_Cmnd *);
-static void dma_advance_sg(Scsi_Cmnd *);
+static void dma_mmu_get_scsi_one(struct NCR_ESP *, struct scsi_cmnd *);
+static void dma_mmu_get_scsi_sgl(struct NCR_ESP *, struct scsi_cmnd *);
+static void dma_mmu_release_scsi_one(struct NCR_ESP *, struct scsi_cmnd *);
+static void dma_mmu_release_scsi_sgl(struct NCR_ESP *, struct scsi_cmnd *);
+static void dma_advance_sg(struct scsi_cmnd *);
 static int  oktagon_notify_reboot(struct notifier_block *this, unsigned long 
code, void *x);
 
 #ifdef USE_BOTTOM_HALF
@@ -395,7 +395,7 @@ static int dma_bytes_sent(struct NCR_ESP *esp, int 
fifo_count)
return fifo_count;
 }
 
-static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp)
+static int dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
unsigned long sz = sp-SCp.this_residual;
if(sz  DMA_MAXTRANSFER)
@@ -542,26 +542,26 @@ static void dma_invalidate(struct NCR_ESP *esp)
  * mmu interface to pass the virtual address, not the physical.
  */
 
-void dma_mmu_get_scsi_one(struct NCR_ESP *esp, Scsi_Cmnd *sp)
+void dma_mmu_get_scsi_one(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
 sp-SCp.ptr =
 sp-request_buffer;
 }
 
-void dma_mmu_get_scsi_sgl(struct NCR_ESP *esp, Scsi_Cmnd *sp)
+void dma_mmu_get_scsi_sgl(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
 sp-SCp.ptr = sg_virt(sp-SCp.buffer);
 }
 
-void dma_mmu_release_scsi_one(struct NCR_ESP *esp, Scsi_Cmnd *sp)
+void dma_mmu_release_scsi_one(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
 }
 
-void dma_mmu_release_scsi_sgl(struct NCR_ESP *esp, Scsi_Cmnd *sp)
+void dma_mmu_release_scsi_sgl(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
 }
 
-void dma_advance_sg(Scsi_Cmnd *sp)
+void dma_advance_sg(struct scsi_cmnd *sp)
 {
sp-SCp.ptr = sg_virt(sp-SCp.buffer);
 }
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 26/33][SCSI] NCR53C9x: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.
Cleaned up checkpatch.pl-errors (so no ' 80 lines'-warning).


diff --git a/drivers/scsi/NCR53C9x.c b/drivers/scsi/NCR53C9x.c
index 5b0efc9..edf81e3 100644
--- a/drivers/scsi/NCR53C9x.c
+++ b/drivers/scsi/NCR53C9x.c
@@ -278,7 +278,7 @@ static char *phase_string(int phase)
 }
 
 #ifdef DEBUG_STATE_MACHINE
-static inline void esp_advance_phase(Scsi_Cmnd *s, int newphase)
+static inline void esp_advance_phase(struct scsi_cmnd *s, int newphase)
 {
ESPLOG((%s, phase_string(newphase)));
s-SCp.sent_command = s-SCp.phase;
@@ -323,49 +323,49 @@ static inline void esp_cmd(struct NCR_ESP *esp, struct 
ESP_regs *eregs,
  * Note that these are per-ESP queues, not global queues like
  * the aha152x driver uses.
  */
-static inline void append_SC(Scsi_Cmnd **SC, Scsi_Cmnd *new_SC)
+static inline void append_SC(struct scsi_cmnd **SC, struct scsi_cmnd *new_SC)
 {
-   Scsi_Cmnd *end;
+   struct scsi_cmnd *end;
 
new_SC-host_scribble = (unsigned char *) NULL;
if(!*SC)
*SC = new_SC;
else {
-   for(end=*SC;end-host_scribble;end=(Scsi_Cmnd 
*)end-host_scribble)
+   for (end = *SC; end-host_scribble; end = (struct scsi_cmnd 
*)end-host_scribble)
;
end-host_scribble = (unsigned char *) new_SC;
}
 }
 
-static inline void prepend_SC(Scsi_Cmnd **SC, Scsi_Cmnd *new_SC)
+static inline void prepend_SC(struct scsi_cmnd **SC, struct scsi_cmnd *new_SC)
 {
new_SC-host_scribble = (unsigned char *) *SC;
*SC = new_SC;
 }
 
-static inline Scsi_Cmnd *remove_first_SC(Scsi_Cmnd **SC)
+static inline struct scsi_cmnd *remove_first_SC(struct scsi_cmnd **SC)
 {
-   Scsi_Cmnd *ptr;
+   struct scsi_cmnd *ptr;
 
ptr = *SC;
if(ptr)
-   *SC = (Scsi_Cmnd *) (*SC)-host_scribble;
+   *SC = (struct scsi_cmnd *) (*SC)-host_scribble;
return ptr;
 }
 
-static inline Scsi_Cmnd *remove_SC(Scsi_Cmnd **SC, int target, int lun)
+static inline struct scsi_cmnd *remove_SC(struct scsi_cmnd **SC, int target, 
int lun)
 {
-   Scsi_Cmnd *ptr, *prev;
+   struct scsi_cmnd *ptr, *prev;
 
for(ptr = *SC, prev = NULL;
ptr  ((ptr-device-id != target) || (ptr-device-lun != lun));
-   prev = ptr, ptr = (Scsi_Cmnd *) ptr-host_scribble)
+   prev = ptr, ptr = (struct scsi_cmnd *) ptr-host_scribble)
;
if(ptr) {
if(prev)
prev-host_scribble=ptr-host_scribble;
else
-   *SC=(Scsi_Cmnd *)ptr-host_scribble;
+   *SC = (struct scsi_cmnd *)ptr-host_scribble;
}
return ptr;
 }
@@ -908,7 +908,7 @@ int esp_proc_info(struct Scsi_Host *shost, char *buffer, 
char **start, off_t off
 }
 EXPORT_SYMBOL(esp_proc_info);
 
-static void esp_get_dmabufs(struct NCR_ESP *esp, Scsi_Cmnd *sp)
+static void esp_get_dmabufs(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
if(sp-use_sg == 0) {
sp-SCp.this_residual = sp-request_bufflen;
@@ -931,7 +931,7 @@ static void esp_get_dmabufs(struct NCR_ESP *esp, Scsi_Cmnd 
*sp)
}
 }
 
-static void esp_release_dmabufs(struct NCR_ESP *esp, Scsi_Cmnd *sp)
+static void esp_release_dmabufs(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
if(sp-use_sg == 0) {
if (esp-dma_mmu_release_scsi_one)
@@ -942,7 +942,7 @@ static void esp_release_dmabufs(struct NCR_ESP *esp, 
Scsi_Cmnd *sp)
}
 }
 
-static void esp_restore_pointers(struct NCR_ESP *esp, Scsi_Cmnd *sp)
+static void esp_restore_pointers(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
struct esp_pointers *ep = esp-data_pointers[scmd_id(sp)];
 
@@ -952,7 +952,7 @@ static void esp_restore_pointers(struct NCR_ESP *esp, 
Scsi_Cmnd *sp)
sp-SCp.buffers_residual = ep-saved_buffers_residual;
 }
 
-static void esp_save_pointers(struct NCR_ESP *esp, Scsi_Cmnd *sp)
+static void esp_save_pointers(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
struct esp_pointers *ep = esp-data_pointers[scmd_id(sp)];
 
@@ -982,7 +982,7 @@ static void esp_save_pointers(struct NCR_ESP *esp, 
Scsi_Cmnd *sp)
  * case where we could see an interrupt is where we have disconnected
  * commands active and they are trying to reselect us.
  */
-static inline void esp_check_cmd(struct NCR_ESP *esp, Scsi_Cmnd *sp)
+static inline void esp_check_cmd(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
switch(sp-cmd_len) {
case 6:
@@ -1013,7 +1013,7 @@ static void esp_exec_cmd(struct NCR_ESP *esp)
 {
struct ESP_regs *eregs = esp-eregs;
struct esp_device *esp_dev;
-   Scsi_Cmnd *SCptr;
+   struct scsi_cmnd *SCptr;
struct scsi_device *SDptr;
volatile unchar *cmdp = esp-esp_command

[PATCH 23/33][SCSI] megaraid: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.
Cleaned up checkpatch.pl-errors.

diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 66c6520..9353472 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -359,7 +359,7 @@ mega_runpendq(adapter_t *adapter)
  * The command queuing entry point for the mid-layer.
  */
 static int
-megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *))
+megaraid_queue(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *))
 {
adapter_t   *adapter;
scb_t   *scb;
@@ -411,7 +411,7 @@ megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *))
  * commands.
  */
 static inline scb_t *
-mega_allocate_scb(adapter_t *adapter, Scsi_Cmnd *cmd)
+mega_allocate_scb(adapter_t *adapter, struct scsi_cmnd *cmd)
 {
struct list_head *head = adapter-free_list;
scb_t   *scb;
@@ -443,7 +443,7 @@ mega_allocate_scb(adapter_t *adapter, Scsi_Cmnd *cmd)
  * and the channel number.
  */
 static inline int
-mega_get_ldrv_num(adapter_t *adapter, Scsi_Cmnd *cmd, int channel)
+mega_get_ldrv_num(adapter_t *adapter, struct scsi_cmnd *cmd, int channel)
 {
int tgt;
int ldrv_num;
@@ -506,7 +506,7 @@ mega_get_ldrv_num(adapter_t *adapter, Scsi_Cmnd *cmd, int 
channel)
  * boot settings.
  */
 static scb_t *
-mega_build_cmd(adapter_t *adapter, Scsi_Cmnd *cmd, int *busy)
+mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy)
 {
mega_ext_passthru   *epthru;
mega_passthru   *pthru;
@@ -944,7 +944,7 @@ mega_build_cmd(adapter_t *adapter, Scsi_Cmnd *cmd, int 
*busy)
  * prepare a command for the scsi physical devices.
  */
 static mega_passthru *
-mega_prepare_passthru(adapter_t *adapter, scb_t *scb, Scsi_Cmnd *cmd,
+mega_prepare_passthru(adapter_t *adapter, scb_t *scb, struct scsi_cmnd *cmd,
int channel, int target)
 {
mega_passthru *pthru;
@@ -1008,7 +1008,7 @@ mega_prepare_passthru(adapter_t *adapter, scb_t *scb, 
Scsi_Cmnd *cmd,
  * commands for devices which can take extended CDBs (10 bytes)
  */
 static mega_ext_passthru *
-mega_prepare_extpassthru(adapter_t *adapter, scb_t *scb, Scsi_Cmnd *cmd,
+mega_prepare_extpassthru(adapter_t *adapter, scb_t *scb, struct scsi_cmnd *cmd,
int channel, int target)
 {
mega_ext_passthru   *epthru;
@@ -1410,7 +1410,7 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int 
nstatus, int status)
 {
mega_ext_passthru   *epthru = NULL;
struct scatterlist  *sgl;
-   Scsi_Cmnd   *cmd = NULL;
+   struct scsi_cmnd*cmd = NULL;
mega_passthru   *pthru = NULL;
mbox_t  *mbox = NULL;
u8  c;
@@ -1662,14 +1662,14 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int 
nstatus, int status)
 static void
 mega_rundoneq (adapter_t *adapter)
 {
-   Scsi_Cmnd *cmd;
+   struct scsi_cmnd *cmd;
struct list_head *pos;
 
list_for_each(pos, adapter-completed_list) {
 
struct scsi_pointer* spos = (struct scsi_pointer *)pos;
 
-   cmd = list_entry(spos, Scsi_Cmnd, SCp);
+   cmd = list_entry(spos, struct scsi_cmnd, SCp);
cmd-scsi_done(cmd);
}
 
@@ -1732,7 +1732,7 @@ static int
 mega_build_sglist(adapter_t *adapter, scb_t *scb, u32 *buf, u32 *len)
 {
struct scatterlist *sg;
-   Scsi_Cmnd   *cmd;
+   struct scsi_cmnd*cmd;
int sgcnt;
int idx;
 
@@ -1879,7 +1879,7 @@ megaraid_info(struct Scsi_Host *host)
  * aborted. All the commands issued to the F/W must complete.
  */
 static int
-megaraid_abort(Scsi_Cmnd *cmd)
+megaraid_abort(struct scsi_cmnd *cmd)
 {
adapter_t   *adapter;
int rval;
@@ -1944,7 +1944,7 @@ megaraid_reset(struct scsi_cmnd *cmd)
  * issued to the controller, abort/reset it. Otherwise return failure
  */
 static int
-megaraid_abort_and_reset(adapter_t *adapter, Scsi_Cmnd *cmd, int aor)
+megaraid_abort_and_reset(adapter_t *adapter, struct scsi_cmnd *cmd, int aor)
 {
struct list_head*pos, *next;
scb_t   *scb;
@@ -4396,7 +4396,7 @@ mega_internal_dev_inquiry(adapter_t *adapter, u8 ch, u8 
tgt,
 static int
 mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru)
 {
-   Scsi_Cmnd   *scmd;
+   struct scsi_cmnd*scmd;
struct  scsi_device *sdev;
scb_t   *scb;
int rval;
@@ -4412,7 +4412,7 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, 
mega_passthru *pthru)
memset(scb, 0, sizeof(scb_t));
 
scmd = adapter-int_scmd;
-   memset(scmd, 0, sizeof(Scsi_Cmnd));
+   memset(scmd, 0, sizeof(struct scsi_cmnd));
 
sdev = kzalloc(sizeof(struct scsi_device), GFP_KERNEL);
scmd-device = sdev

[PATCH 22/33][SCSI] mca_53c9x: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.


diff --git a/drivers/scsi/mca_53c9x.c b/drivers/scsi/mca_53c9x.c
index d693d0f..5dbc259 100644
--- a/drivers/scsi/mca_53c9x.c
+++ b/drivers/scsi/mca_53c9x.c
@@ -77,7 +77,7 @@
 }
 
 static int  dma_bytes_sent(struct NCR_ESP *, int);
-static int  dma_can_transfer(struct NCR_ESP *, Scsi_Cmnd *);
+static int  dma_can_transfer(struct NCR_ESP *, struct scsi_cmnd *);
 static void dma_dump_state(struct NCR_ESP *);
 static void dma_init_read(struct NCR_ESP *, __u32, int);
 static void dma_init_write(struct NCR_ESP *, __u32, int);
@@ -313,7 +313,7 @@ static int dma_bytes_sent(struct NCR_ESP *esp, int 
fifo_count)
return fifo_count;
 }
 
-static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp)
+static int dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
/* 
 * The MCA dma channels can only do up to 128K bytes at a time.
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 21/33][SCSI] mac_esp: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.
Cleaned up checkpatch.pl-errors.


diff --git a/drivers/scsi/mac_esp.c b/drivers/scsi/mac_esp.c
index bcb4902..85f3d47 100644
--- a/drivers/scsi/mac_esp.c
+++ b/drivers/scsi/mac_esp.c
@@ -47,7 +47,7 @@ extern void esp_handle(struct NCR_ESP *esp);
 extern void mac_esp_intr(int irq, void *dev_id);
 
 static int  dma_bytes_sent(struct NCR_ESP * esp, int fifo_count);
-static int  dma_can_transfer(struct NCR_ESP * esp, Scsi_Cmnd *sp);
+static int  dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp);
 static void dma_dump_state(struct NCR_ESP * esp);
 static void dma_init_read(struct NCR_ESP * esp, char * vaddress, int length);
 static void dma_init_write(struct NCR_ESP * esp, char * vaddress, int length);
@@ -582,7 +582,7 @@ static int dma_bytes_sent(struct NCR_ESP * esp, int 
fifo_count)
  * is ever implemented. Returning 0 here will use PIO.
  */
 
-static int dma_can_transfer(struct NCR_ESP * esp, Scsi_Cmnd * sp)
+static int dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
unsigned long sz = sp-SCp.this_residual;
 #if 0  /* no DMA yet; make conditional */
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 15/33][SCSI] gdth: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.


diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index b253b8c..3c3e271 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -144,14 +144,14 @@ static irqreturn_t gdth_interrupt(int irq, void *dev_id);
 static irqreturn_t __gdth_interrupt(gdth_ha_str *ha, int irq,
 int gdth_from_wait, int* pIndex);
 static int gdth_sync_event(gdth_ha_str *ha, int service, unchar index,
-   Scsi_Cmnd *scp);
+   struct 
scsi_cmnd *scp);
 static int gdth_async_event(gdth_ha_str *ha);
 static void gdth_log_event(gdth_evt_data *dvr, char *buffer);
 
-static void gdth_putq(gdth_ha_str *ha, Scsi_Cmnd *scp, unchar priority);
+static void gdth_putq(gdth_ha_str *ha, struct scsi_cmnd *scp, unchar priority);
 static void gdth_next(gdth_ha_str *ha);
-static int gdth_fill_raw_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, unchar b);
-static int gdth_special_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp);
+static int gdth_fill_raw_cmd(gdth_ha_str *ha, struct scsi_cmnd *scp, unchar b);
+static int gdth_special_cmd(gdth_ha_str *ha, struct scsi_cmnd *scp);
 static gdth_evt_str *gdth_store_event(gdth_ha_str *ha, ushort source,
   ushort idx, gdth_evt_data *evt);
 static int gdth_read_event(gdth_ha_str *ha, int handle, gdth_evt_str *estr);
@@ -159,10 +159,10 @@ static void gdth_readapp_event(gdth_ha_str *ha, unchar 
application,
gdth_evt_str *estr);
 static void gdth_clear_events(void);
 
-static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp,
+static void gdth_copy_internal_data(gdth_ha_str *ha, struct scsi_cmnd *scp,
 char *buffer, ushort count, int to_buffer);
-static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp);
-static int gdth_fill_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, ushort hdrive);
+static int gdth_internal_cache_cmd(gdth_ha_str *ha, struct scsi_cmnd *scp);
+static int gdth_fill_cache_cmd(gdth_ha_str *ha, struct scsi_cmnd *scp, ushort 
hdrive);
 
 static void gdth_enable_int(gdth_ha_str *ha);
 static unchar gdth_get_status(gdth_ha_str *ha, int irq);
@@ -184,7 +184,7 @@ static int gdth_ioctl(struct inode *inode, struct file 
*filep,
 
 static void gdth_flush(gdth_ha_str *ha);
 static int gdth_halt(struct notifier_block *nb, ulong event, void *buf);
-static int gdth_queuecommand(Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *));
+static int gdth_queuecommand(struct scsi_cmnd *scp,void (*done)(struct 
scsi_cmnd *));
 static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp,
struct gdth_cmndinfo *cmndinfo);
 static void gdth_scsi_done(struct scsi_cmnd *scp);
@@ -492,7 +492,7 @@ int __gdth_execute(struct scsi_device *sdev, gdth_cmd_str 
*gdtcmd, char *cmnd,
int timeout, u32 *info)
 {
 gdth_ha_str *ha = shost_priv(sdev-host);
-Scsi_Cmnd *scp;
+struct scsi_cmnd *scp;
 struct gdth_cmndinfo cmndinfo;
 struct scatterlist one_sg;
 DECLARE_COMPLETION_ONSTACK(wait);
@@ -2050,11 +2050,11 @@ static int gdth_analyse_hdrive(gdth_ha_str *ha, ushort 
hdrive)
 
 /* command queueing/sending functions */
 
-static void gdth_putq(gdth_ha_str *ha, Scsi_Cmnd *scp, unchar priority)
+static void gdth_putq(gdth_ha_str *ha, struct scsi_cmnd *scp, unchar priority)
 {
 struct gdth_cmndinfo *cmndinfo = gdth_cmnd_priv(scp);
-register Scsi_Cmnd *pscp;
-register Scsi_Cmnd *nscp;
+register struct scsi_cmnd *pscp;
+register struct scsi_cmnd *nscp;
 ulong flags;
 unchar b, t;
 
@@ -2079,11 +2079,11 @@ static void gdth_putq(gdth_ha_str *ha, Scsi_Cmnd *scp, 
unchar priority)
 scp-SCp.ptr = NULL;
 } else {/* queue not empty */
 pscp = ha-req_first;
-nscp = (Scsi_Cmnd *)pscp-SCp.ptr;
+nscp = (struct scsi_cmnd *)pscp-SCp.ptr;
 /* priority: 0-highest,..,0xff-lowest */
 while (nscp  gdth_cmnd_priv(nscp)-priority = priority) {
 pscp = nscp;
-nscp = (Scsi_Cmnd *)pscp-SCp.ptr;
+nscp = (struct scsi_cmnd *)pscp-SCp.ptr;
 }
 pscp-SCp.ptr = (char *)scp;
 scp-SCp.ptr  = (char *)nscp;
@@ -2092,7 +2092,7 @@ static void gdth_putq(gdth_ha_str *ha, Scsi_Cmnd *scp, 
unchar priority)
 
 #ifdef GDTH_STATISTICS
 flags = 0;
-for (nscp=ha-req_first; nscp; nscp=(Scsi_Cmnd*)nscp-SCp.ptr)
+for (nscp=ha-req_first; nscp; nscp=(struct scsi_cmnd*)nscp-SCp.ptr)
 ++flags;
 if (max_rq  flags) {
 max_rq = flags;
@@ -2103,8 +2103,8 @@ static void gdth_putq(gdth_ha_str *ha, Scsi_Cmnd *scp, 
unchar priority)
 
 static void gdth_next(gdth_ha_str *ha)
 {
-register

[PATCH 14/33][SCSI] fd_mcs: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.
Cleaned up checkpatch.pl-errors (so no ' 80 lines'-warning).


diff --git a/drivers/scsi/fd_mcs.c b/drivers/scsi/fd_mcs.c
index 8335b60..5feb9f2 100644
--- a/drivers/scsi/fd_mcs.c
+++ b/drivers/scsi/fd_mcs.c
@@ -184,7 +184,7 @@ struct fd_hostdata {
int _bios_major;
int _bios_minor;
volatile int _in_command;
-   Scsi_Cmnd *_current_SC;
+   struct scsi_cmnd *_current_SC;
enum chip_type _chip;
int _adapter_mask;
int _fifo_count;/* Number of 512 byte blocks before INTR */
@@ -1089,7 +1089,7 @@ static int fd_mcs_release(struct Scsi_Host *shpnt)
return 0;
 }
 
-static int fd_mcs_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
+static int fd_mcs_queue(struct scsi_cmnd *SCpnt, void (*done) (struct 
scsi_cmnd *))
 {
struct Scsi_Host *shpnt = SCpnt-device-host;
 
@@ -1138,7 +1138,7 @@ static int fd_mcs_queue(Scsi_Cmnd * SCpnt, void (*done) 
(Scsi_Cmnd *))
 }
 
 #if DEBUG_ABORT || DEBUG_RESET
-static void fd_mcs_print_info(Scsi_Cmnd * SCpnt)
+static void fd_mcs_print_info(struct scsi_cmnd *SCpnt)
 {
unsigned int imr;
unsigned int irr;
@@ -1207,7 +1207,7 @@ static void fd_mcs_print_info(Scsi_Cmnd * SCpnt)
 }
 #endif
 
-static int fd_mcs_abort(Scsi_Cmnd * SCpnt)
+static int fd_mcs_abort(struct scsi_cmnd *SCpnt)
 {
struct Scsi_Host *shpnt = SCpnt-device-host;
 
@@ -1243,7 +1243,8 @@ static int fd_mcs_abort(Scsi_Cmnd * SCpnt)
return SUCCESS;
 }
 
-static int fd_mcs_bus_reset(Scsi_Cmnd * SCpnt) {
+static int fd_mcs_bus_reset(struct scsi_cmnd *SCpnt)
+{
struct Scsi_Host *shpnt = SCpnt-device-host;
unsigned long flags;
 
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 12/33][SCSI] dtc: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.


diff --git a/drivers/scsi/dtc.h b/drivers/scsi/dtc.h
index 0b205f8..524b711 100644
--- a/drivers/scsi/dtc.h
+++ b/drivers/scsi/dtc.h
@@ -32,12 +32,12 @@
 #define DTCDEBUG_INIT  0x1
 #define DTCDEBUG_TRANSFER 0x2
 
-static int dtc_abort(Scsi_Cmnd *);
+static int dtc_abort(struct scsi_cmnd *);
 static int dtc_biosparam(struct scsi_device *, struct block_device *,
 sector_t, int*);
 static int dtc_detect(struct scsi_host_template *);
-static int dtc_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
-static int dtc_bus_reset(Scsi_Cmnd *);
+static int dtc_queue_command(struct scsi_cmnd *, void (*done)(struct scsi_cmnd 
*));
+static int dtc_bus_reset(struct scsi_cmnd *);
 
 #ifndef CMD_PER_LUN
 #define CMD_PER_LUN 2
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 11/33][SCSI] cyberstormII: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.


diff --git a/drivers/scsi/cyberstormII.c b/drivers/scsi/cyberstormII.c
index e336e85..e1d9c56 100644
--- a/drivers/scsi/cyberstormII.c
+++ b/drivers/scsi/cyberstormII.c
@@ -62,7 +62,7 @@ struct cyberII_dma_registers {
 #define CYBERII_DMA_LED0x02/* HD led control 1 = on */
 
 static int  dma_bytes_sent(struct NCR_ESP *esp, int fifo_count);
-static int  dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp);
+static int  dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp);
 static void dma_dump_state(struct NCR_ESP *esp);
 static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length);
 static void dma_init_write(struct NCR_ESP *esp, __u32 addr, int length);
@@ -183,7 +183,7 @@ static int dma_bytes_sent(struct NCR_ESP *esp, int 
fifo_count)
return fifo_count;
 }
 
-static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp)
+static int dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
/* I don't think there's any limit on the CyberDMA. So we use what
 * the ESP chip can handle (24 bit).
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 10/33][SCSI] cyberstorm: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.


diff --git a/drivers/scsi/cyberstorm.c b/drivers/scsi/cyberstorm.c
index c6b98a4..3f8d1b0 100644
--- a/drivers/scsi/cyberstorm.c
+++ b/drivers/scsi/cyberstorm.c
@@ -79,7 +79,7 @@ struct cyber_dma_registers {
 #define CYBER_SLOW_CABLE 0x08  /* If *not* set, assume SLOW_CABLE */
 
 static int  dma_bytes_sent(struct NCR_ESP *esp, int fifo_count);
-static int  dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp);
+static int  dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp);
 static void dma_dump_state(struct NCR_ESP *esp);
 static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length);
 static void dma_init_write(struct NCR_ESP *esp, __u32 addr, int length);
@@ -206,7 +206,7 @@ static int dma_bytes_sent(struct NCR_ESP *esp, int 
fifo_count)
return fifo_count;
 }
 
-static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp)
+static int dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
/* I don't think there's any limit on the CyberDMA. So we use what
 * the ESP chip can handle (24 bit).
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/33][SCSI] atari_scsi: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.
Cleaned up checkpatch.pl-warnings.


diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c
index f5732d8..a5d6ab4 100644
--- a/drivers/scsi/atari_scsi.c
+++ b/drivers/scsi/atari_scsi.c
@@ -189,9 +189,9 @@ static inline void DISABLE_IRQ(void)
 static int scsi_dma_is_ignored_buserr(unsigned char dma_stat);
 static void atari_scsi_fetch_restbytes(void);
 static long atari_scsi_dma_residual(struct Scsi_Host *instance);
-static int falcon_classify_cmd(Scsi_Cmnd *cmd);
+static int falcon_classify_cmd(struct scsi_cmnd *cmd);
 static unsigned long atari_dma_xfer_len(unsigned long wanted_len,
-   Scsi_Cmnd *cmd, int write_flag);
+   struct scsi_cmnd *cmd, int write_flag);
 #endif
 static irqreturn_t scsi_tt_intr(int irq, void *dummy);
 static irqreturn_t scsi_falcon_intr(int irq, void *dummy);
@@ -582,7 +582,7 @@ static void falcon_get_lock(void)
  */
 
 #if 0
-int atari_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
+int atari_queue_command(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd 
*))
 {
/* falcon_get_lock();
 * ++guenther: moved to NCR5380_queue_command() to prevent
@@ -812,7 +812,7 @@ void __init atari_scsi_setup(char *str, int *ints)
 #endif
 }
 
-int atari_scsi_bus_reset(Scsi_Cmnd *cmd)
+int atari_scsi_bus_reset(struct scsi_cmnd *cmd)
 {
int rv;
struct NCR5380_hostdata *hostdata =
@@ -972,7 +972,7 @@ static long atari_scsi_dma_residual(struct Scsi_Host 
*instance)
 #defineCMD_SURELY_BYTE_MODE1
 #defineCMD_MODE_UNKNOWN2
 
-static int falcon_classify_cmd(Scsi_Cmnd *cmd)
+static int falcon_classify_cmd(struct scsi_cmnd *cmd)
 {
unsigned char opcode = cmd-cmnd[0];
 
@@ -1004,7 +1004,7 @@ static int falcon_classify_cmd(Scsi_Cmnd *cmd)
  */
 
 static unsigned long atari_dma_xfer_len(unsigned long wanted_len,
-   Scsi_Cmnd *cmd, int write_flag)
+   struct scsi_cmnd *cmd, int write_flag)
 {
unsigned long   possible_len, limit;
 #ifndef CONFIG_TT_DMA_EMUL
diff --git a/drivers/scsi/atari_scsi.h b/drivers/scsi/atari_scsi.h
index efadb8d..48c1e46 100644
--- a/drivers/scsi/atari_scsi.h
+++ b/drivers/scsi/atari_scsi.h
@@ -20,7 +20,7 @@
 #ifndef ASM
 int atari_scsi_detect (struct scsi_host_template *);
 const char *atari_scsi_info (struct Scsi_Host *);
-int atari_scsi_reset (Scsi_Cmnd *, unsigned int);
+int atari_scsi_reset(struct scsi_cmnd *, unsigned int);
 int atari_scsi_release (struct Scsi_Host *);
 
 /* The values for CMD_PER_LUN and CAN_QUEUE are somehow arbitrary. Higher
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 8/33][SCSI] blz1230: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.


diff --git a/drivers/scsi/blz1230.c b/drivers/scsi/blz1230.c
index 23f7c24..323038c 100644
--- a/drivers/scsi/blz1230.c
+++ b/drivers/scsi/blz1230.c
@@ -77,7 +77,7 @@ struct blz1230II_dma_registers {
 #define BLZ1230_DMA_WRITE 0x8000
 
 static int  dma_bytes_sent(struct NCR_ESP *esp, int fifo_count);
-static int  dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp);
+static int  dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp);
 static void dma_dump_state(struct NCR_ESP *esp);
 static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length);
 static void dma_init_write(struct NCR_ESP *esp, __u32 addr, int length);
@@ -211,7 +211,7 @@ static int dma_bytes_sent(struct NCR_ESP *esp, int 
fifo_count)
return fifo_count;
 }
 
-static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp)
+static int dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
/* I don't think there's any limit on the Blizzard DMA. So we use what
 * the ESP chip can handle (24 bit).
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 9/33][SCSI] blz2060: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.


diff --git a/drivers/scsi/blz2060.c b/drivers/scsi/blz2060.c
index b6203ec..c7b98b8 100644
--- a/drivers/scsi/blz2060.c
+++ b/drivers/scsi/blz2060.c
@@ -71,7 +71,7 @@ struct blz2060_dma_registers {
 #define BLZ2060_DMA_LED0x02/* HD led control 1 = off */
 
 static int  dma_bytes_sent(struct NCR_ESP *esp, int fifo_count);
-static int  dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp);
+static int  dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp);
 static void dma_dump_state(struct NCR_ESP *esp);
 static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length);
 static void dma_init_write(struct NCR_ESP *esp, __u32 addr, int length);
@@ -176,7 +176,7 @@ static int dma_bytes_sent(struct NCR_ESP *esp, int 
fifo_count)
return fifo_count;
 }
 
-static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp)
+static int dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
/* I don't think there's any limit on the Blizzard DMA. So we use what
 * the ESP chip can handle (24 bit).
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 13/33][SCSI] fastlane: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.


diff --git a/drivers/scsi/fastlane.c b/drivers/scsi/fastlane.c
index 4266a21..c16df66 100644
--- a/drivers/scsi/fastlane.c
+++ b/drivers/scsi/fastlane.c
@@ -84,7 +84,7 @@ struct fastlane_dma_registers {
 #define FASTLANE_DMA_ESI   0x01/* Enable SCSI IRQ */
 
 static int  dma_bytes_sent(struct NCR_ESP *esp, int fifo_count);
-static int  dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp);
+static int  dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp);
 static void dma_dump_state(struct NCR_ESP *esp);
 static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length);
 static void dma_init_write(struct NCR_ESP *esp, __u32 vaddr, int length);
@@ -254,7 +254,7 @@ static int dma_bytes_sent(struct NCR_ESP *esp, int 
fifo_count)
return fifo_count;
 }
 
-static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp)
+static int dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
unsigned long sz = sp-SCp.this_residual;
if(sz  0xfffc)
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 17/33][SCSI] g_NCR5380: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.


diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
index 75585a5..5303e1d 100644
--- a/drivers/scsi/g_NCR5380.c
+++ b/drivers/scsi/g_NCR5380.c
@@ -774,7 +774,7 @@ static int sprint_command(char *buffer, int len, unsigned 
char *command)
  * Print out the target and command data in hex
  */
 
-static int sprint_Scsi_Cmnd(char *buffer, int len, Scsi_Cmnd * cmd)
+static int sprint_Scsi_Cmnd(char *buffer, int len, struct scsi_cmnd *cmd)
 {
int start = len;
PRINTP(host number %d destination target %d, lun %d\n ANDP 
cmd-device-host-host_no ANDP cmd-device-id ANDP cmd-device-lun);
@@ -807,7 +807,7 @@ static int generic_NCR5380_proc_info(struct Scsi_Host 
*scsi_ptr, char *buffer, c
unsigned long flags;
unsigned char status;
int i;
-   Scsi_Cmnd *ptr;
+   struct scsi_cmnd *ptr;
struct NCR5380_hostdata *hostdata;
 #ifdef NCR5380_STATS
struct scsi_device *dev;
@@ -886,17 +886,17 @@ static int generic_NCR5380_proc_info(struct Scsi_Host 
*scsi_ptr, char *buffer, c
if (!hostdata-connected) {
PRINTP(No currently connected command\n);
} else {
-   len += sprint_Scsi_Cmnd(buffer, len, (Scsi_Cmnd *) 
hostdata-connected);
+   len += sprint_Scsi_Cmnd(buffer, len, (struct scsi_cmnd *) 
hostdata-connected);
}
 
PRINTP(issue_queue\n);
 
-   for (ptr = (Scsi_Cmnd *) hostdata-issue_queue; ptr; ptr = (Scsi_Cmnd 
*) ptr-host_scribble)
+   for (ptr = (struct scsi_cmnd *) hostdata-issue_queue; ptr; ptr = 
(struct scsi_cmnd *) ptr-host_scribble)
len += sprint_Scsi_Cmnd(buffer, len, ptr);
 
PRINTP(disconnected_queue\n);
 
-   for (ptr = (Scsi_Cmnd *) hostdata-disconnected_queue; ptr; ptr = 
(Scsi_Cmnd *) ptr-host_scribble)
+   for (ptr = (struct scsi_cmnd *) hostdata-disconnected_queue; ptr; ptr 
= (struct scsi_cmnd *) ptr-host_scribble)
len += sprint_Scsi_Cmnd(buffer, len, ptr);
 
*start = buffer + offset;
diff --git a/drivers/scsi/g_NCR5380.h b/drivers/scsi/g_NCR5380.h
index df0b3f6..a49e789 100644
--- a/drivers/scsi/g_NCR5380.h
+++ b/drivers/scsi/g_NCR5380.h
@@ -43,11 +43,11 @@
 #endif
 
 #ifndef ASM
-static int generic_NCR5380_abort(Scsi_Cmnd *);
+static int generic_NCR5380_abort(struct scsi_cmnd *);
 static int generic_NCR5380_detect(struct scsi_host_template *);
 static int generic_NCR5380_release_resources(struct Scsi_Host *);
-static int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd 
*));
-static int generic_NCR5380_bus_reset(Scsi_Cmnd *);
+static int generic_NCR5380_queue_command(struct scsi_cmnd *, void 
(*done)(struct scsi_cmnd *));
+static int generic_NCR5380_bus_reset(struct scsi_cmnd *);
 static const char* generic_NCR5380_info(struct Scsi_Host *);
 
 #ifndef CMD_PER_LUN
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 18/33][SCSI] ibmmca: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.
Cleaned up checkpatch.pl-errors (so no ' 80 lines'-warning).


diff --git a/drivers/scsi/ibmmca.c b/drivers/scsi/ibmmca.c
index db004a4..5863d70 100644
--- a/drivers/scsi/ibmmca.c
+++ b/drivers/scsi/ibmmca.c
@@ -39,9 +39,9 @@
 #include scsi/scsi_host.h
 
 /* Common forward declarations for all Linux-versions: */
-static int ibmmca_queuecommand (Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
-static int ibmmca_abort (Scsi_Cmnd *);
-static int ibmmca_host_reset (Scsi_Cmnd *);
+static int ibmmca_queuecommand(struct scsi_cmnd *, void (*done) (struct 
scsi_cmnd *));
+static int ibmmca_abort(struct scsi_cmnd *);
+static int ibmmca_host_reset(struct scsi_cmnd *);
 static int ibmmca_biosparam (struct scsi_device *, struct block_device *, 
sector_t, int *);
 static int ibmmca_proc_info(struct Scsi_Host *shpnt, char *buffer, char 
**start, off_t offset, int length, int inout);
 
@@ -315,7 +315,7 @@ struct logical_device {
struct im_tsb tsb;  /* SCSI command complete status block structure 
*/
struct im_sge sge[16];  /* scatter gather list structure */
unsigned char buf[256]; /* SCSI command return data buffer */
-   Scsi_Cmnd *cmd; /* SCSI-command that is currently in progress */
+   struct scsi_cmnd *cmd;  /* SCSI-command that is currently in progress */
int device_type;/* type of the SCSI-device. See 
include/scsi/scsi.h
   for interpretation of the possible values */
int block_length;   /* blocksize of a particular logical 
SCSI-device */
@@ -476,7 +476,7 @@ static char ibm_ansi_order = 0;
 #endif
 
 static void issue_cmd(struct Scsi_Host *, unsigned long, unsigned char);
-static void internal_done(Scsi_Cmnd * cmd);
+static void internal_done(struct scsi_cmnd *cmd);
 static void check_devices(struct Scsi_Host *, int);
 static int immediate_assign(struct Scsi_Host *, unsigned int, unsigned int, 
unsigned int, unsigned int);
 static int immediate_feature(struct Scsi_Host *, unsigned int, unsigned int);
@@ -503,7 +503,7 @@ static irqreturn_t interrupt_handler(int irq, void *dev_id)
unsigned int cmd_result;
unsigned int ldn;
unsigned long flags;
-   Scsi_Cmnd *cmd;
+   struct scsi_cmnd *cmd;
int lastSCSI;
struct device *dev = dev_id;
struct Scsi_Host *shpnt = dev_get_drvdata(dev);
@@ -726,7 +726,7 @@ static void issue_cmd(struct Scsi_Host *shpnt, unsigned 
long cmd_reg,
spin_unlock_irqrestore(shpnt-host_lock, flags);
 }
 
-static void internal_done(Scsi_Cmnd * cmd)
+static void internal_done(struct scsi_cmnd *cmd)
 {
cmd-SCp.Status++;
return;
@@ -1692,7 +1692,7 @@ static int __devexit ibmmca_remove(struct device *dev)
 }
 
 /* The following routine is the SCSI command queue for the midlevel driver */
-static int ibmmca_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
+static int ibmmca_queuecommand(struct scsi_cmnd *cmd, void (*done) (struct 
scsi_cmnd *))
 {
unsigned int ldn;
unsigned int scsi_cmd;
@@ -1997,7 +1997,7 @@ static int ibmmca_queuecommand(Scsi_Cmnd * cmd, void 
(*done) (Scsi_Cmnd *))
return 0;
 }
 
-static int __ibmmca_abort(Scsi_Cmnd * cmd)
+static int __ibmmca_abort(struct scsi_cmnd *cmd)
 {
/* Abort does not work, as the adapter never generates an interrupt on
 * whatever situation is simulated, even when really pending commands
@@ -2005,7 +2005,7 @@ static int __ibmmca_abort(Scsi_Cmnd * cmd)
 
struct Scsi_Host *shpnt;
unsigned int ldn;
-   void (*saved_done) (Scsi_Cmnd *);
+   void (*saved_done) (struct scsi_cmnd *);
int target;
int max_pun;
unsigned long imm_command;
@@ -2091,7 +2091,7 @@ static int __ibmmca_abort(Scsi_Cmnd * cmd)
}
 }
 
-static int ibmmca_abort(Scsi_Cmnd * cmd)
+static int ibmmca_abort(struct scsi_cmnd *cmd)
 {
struct Scsi_Host *shpnt = cmd-device-host;
int rc;
@@ -2103,10 +2103,10 @@ static int ibmmca_abort(Scsi_Cmnd * cmd)
return rc;
 }
 
-static int __ibmmca_host_reset(Scsi_Cmnd * cmd)
+static int __ibmmca_host_reset(struct scsi_cmnd *cmd)
 {
struct Scsi_Host *shpnt;
-   Scsi_Cmnd *cmd_aid;
+   struct scsi_cmnd *cmd_aid;
int ticks, i;
unsigned long imm_command;
 
@@ -2183,7 +2183,7 @@ static int __ibmmca_host_reset(Scsi_Cmnd * cmd)
return SUCCESS;
 }
 
-static int ibmmca_host_reset(Scsi_Cmnd * cmd)
+static int ibmmca_host_reset(struct scsi_cmnd *cmd)
 {
struct Scsi_Host *shpnt = cmd-device-host;
int rc;
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 19/33][SCSI] ibmvscsi: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.


diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 5f2396c..d517f32 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -375,7 +375,7 @@ static int map_sg_list(struct scsi_cmnd *cmd, int nseg,
 
 /**
  * map_sg_data: - Maps dma for a scatterlist and initializes decriptor fields
- * @cmd:   Scsi_Cmnd with the scatterlist
+ * @cmd:   scsi_cmnd with the scatterlist
  * @srp_cmd:   srp_cmd that contains the memory descriptor
  * @dev:   device for which to map dma memory
  *
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 20/33][SCSI] in2000: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.
Cleaned up checkpatch.pl-errors (so no ' 80 lines'-warning).


diff --git a/drivers/scsi/in2000.c b/drivers/scsi/in2000.c
index c8b452f..05737ef 100644
--- a/drivers/scsi/in2000.c
+++ b/drivers/scsi/in2000.c
@@ -255,7 +255,7 @@ static unsigned long read_3393_count(struct IN2000_hostdata 
*hostdata)
  * will be a DATA_OUT phase with this command, false otherwise.
  * (Thanks to Joerg Dorchain for the research and suggestion.)
  */
-static int is_dir_out(Scsi_Cmnd * cmd)
+static int is_dir_out(struct scsi_cmnd *cmd)
 {
switch (cmd-cmnd[0]) {
case WRITE_6:
@@ -334,18 +334,18 @@ static uchar calc_sync_xfer(unsigned int period, unsigned 
int offset)
 
 static void in2000_execute(struct Scsi_Host *instance);
 
-static int in2000_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
+static int in2000_queuecommand(struct scsi_cmnd *cmd, void (*done) (struct 
scsi_cmnd *))
 {
struct Scsi_Host *instance;
struct IN2000_hostdata *hostdata;
-   Scsi_Cmnd *tmp;
+   struct scsi_cmnd *tmp;
 
instance = cmd-device-host;
hostdata = (struct IN2000_hostdata *) instance-hostdata;
 
DB(DB_QUEUE_COMMAND, scmd_printk(KERN_DEBUG, cmd, Q-%02x-%ld(, 
cmd-cmnd[0], cmd-serial_number))
 
-/* Set up a few fields in the Scsi_Cmnd structure for our own use:
+/* Set up a few fields in the scsi_cmnd structure for our own use:
  *  - host_scribble is the pointer to the next cmd in the input queue
  *  - scsi_done points to the routine we call when a cmd is finished
  *  - result is what you'd expect
@@ -417,7 +417,7 @@ static int in2000_queuecommand(Scsi_Cmnd * cmd, void 
(*done) (Scsi_Cmnd *))
cmd-host_scribble = (uchar *) hostdata-input_Q;
hostdata-input_Q = cmd;
} else {/* find the end of the queue */
-   for (tmp = (Scsi_Cmnd *) hostdata-input_Q; tmp-host_scribble; 
tmp = (Scsi_Cmnd *) tmp-host_scribble);
+   for (tmp = (struct scsi_cmnd *) hostdata-input_Q; 
tmp-host_scribble; tmp = (struct scsi_cmnd *) tmp-host_scribble);
tmp-host_scribble = (uchar *) cmd;
}
 
@@ -444,7 +444,7 @@ static int in2000_queuecommand(Scsi_Cmnd * cmd, void 
(*done) (Scsi_Cmnd *))
 static void in2000_execute(struct Scsi_Host *instance)
 {
struct IN2000_hostdata *hostdata;
-   Scsi_Cmnd *cmd, *prev;
+   struct scsi_cmnd *cmd, *prev;
int i;
unsigned short *sp;
unsigned short f;
@@ -467,13 +467,13 @@ static void in2000_execute(struct Scsi_Host *instance)
 * for an idle target/lun.
 */
 
-   cmd = (Scsi_Cmnd *) hostdata-input_Q;
+   cmd = (struct scsi_cmnd *) hostdata-input_Q;
prev = NULL;
while (cmd) {
if (!(hostdata-busy[cmd-device-id]  (1  
cmd-device-lun)))
break;
prev = cmd;
-   cmd = (Scsi_Cmnd *) cmd-host_scribble;
+   cmd = (struct scsi_cmnd *) cmd-host_scribble;
}
 
/* quit if queue empty or all possible targets are busy */
@@ -490,7 +490,7 @@ static void in2000_execute(struct Scsi_Host *instance)
if (prev)
prev-host_scribble = cmd-host_scribble;
else
-   hostdata-input_Q = (Scsi_Cmnd *) cmd-host_scribble;
+   hostdata-input_Q = (struct scsi_cmnd *) cmd-host_scribble;
 
 #ifdef PROC_STATISTICS
hostdata-cmd_cnt[cmd-device-id]++;
@@ -539,9 +539,9 @@ static void in2000_execute(struct Scsi_Host *instance)
goto yes;
if (!(hostdata-input_Q))   /* input_Q empty? */
goto no;
-   for (prev = (Scsi_Cmnd *) hostdata-input_Q; prev; prev = (Scsi_Cmnd *) 
prev-host_scribble) {
+   for (prev = (struct scsi_cmnd *) hostdata-input_Q; prev; prev = 
(struct scsi_cmnd *) prev-host_scribble) {
if ((prev-device-id != cmd-device-id) || (prev-device-lun 
!= cmd-device-lun)) {
-   for (prev = (Scsi_Cmnd *) hostdata-input_Q; prev; prev 
= (Scsi_Cmnd *) prev-host_scribble)
+   for (prev = (struct scsi_cmnd *) hostdata-input_Q; 
prev; prev = (struct scsi_cmnd *) prev-host_scribble)
prev-SCp.phase = 1;
goto yes;
}
@@ -743,7 +743,7 @@ static void transfer_pio(uchar * buf, int cnt, int 
data_in_dir, struct IN2000_ho
 
 
 
-static void transfer_bytes(Scsi_Cmnd * cmd, int data_in_dir)
+static void transfer_bytes(struct scsi_cmnd *cmd, int data_in_dir)
 {
struct IN2000_hostdata *hostdata;
unsigned short *sp;
@@ -833,7 +833,7 @@ static irqreturn_t in2000_intr(int irqnum, void *dev_id)
 {
struct Scsi_Host *instance = dev_id;
struct IN2000_hostdata *hostdata;
-   Scsi_Cmnd *patch, *cmd;
+   struct

[PATCH 24/33][SCSI] NCR5380: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.
Cleaned up checkpatch.pl-errors (so no ' 80 lines'-warning, and etc).


diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 2597209..6c09976 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -288,7 +288,7 @@ static void do_reset(struct Scsi_Host *host);
  * Set up the internal fields in the SCSI command.
  */
 
-static __inline__ void initialize_SCp(Scsi_Cmnd * cmd)
+static inline void initialize_SCp(struct scsi_cmnd *cmd)
 {
/* 
 * Initialize the Scsi Pointer field so that all of the commands in the 
@@ -698,7 +698,7 @@ static void NCR5380_print_status(struct Scsi_Host *instance)
 #undef SPRINTF
 #define SPRINTF(args...) do { if(pos  buffer + length-80) pos += sprintf(pos, 
## args); } while(0)
 static
-char *lprint_Scsi_Cmnd(Scsi_Cmnd * cmd, char *pos, char *buffer, int length);
+char *lprint_Scsi_Cmnd(struct scsi_cmnd *cmd, char *pos, char *buffer, int 
length);
 static
 char *lprint_command(unsigned char *cmd, char *pos, char *buffer, int len);
 static
@@ -709,7 +709,7 @@ static int __maybe_unused NCR5380_proc_info(struct 
Scsi_Host *instance,
 {
char *pos = buffer;
struct NCR5380_hostdata *hostdata;
-   Scsi_Cmnd *ptr;
+   struct scsi_cmnd *ptr;
 
hostdata = (struct NCR5380_hostdata *) instance-hostdata;
 
@@ -755,13 +755,13 @@ static int __maybe_unused NCR5380_proc_info(struct 
Scsi_Host *instance,
if (!hostdata-connected)
SPRINTF(scsi%d: no currently connected command\n, 
instance-host_no);
else
-   pos = lprint_Scsi_Cmnd((Scsi_Cmnd *) hostdata-connected, pos, 
buffer, length);
+   pos = lprint_Scsi_Cmnd((struct scsi_cmnd *) 
hostdata-connected, pos, buffer, length);
SPRINTF(scsi%d: issue_queue\n, instance-host_no);
-   for (ptr = (Scsi_Cmnd *) hostdata-issue_queue; ptr; ptr = (Scsi_Cmnd 
*) ptr-host_scribble)
+   for (ptr = (struct scsi_cmnd *) hostdata-issue_queue; ptr; ptr = 
(struct scsi_cmnd *) ptr-host_scribble)
pos = lprint_Scsi_Cmnd(ptr, pos, buffer, length);
 
SPRINTF(scsi%d: disconnected_queue\n, instance-host_no);
-   for (ptr = (Scsi_Cmnd *) hostdata-disconnected_queue; ptr; ptr = 
(Scsi_Cmnd *) ptr-host_scribble)
+   for (ptr = (struct scsi_cmnd *) hostdata-disconnected_queue; ptr; ptr 
= (struct scsi_cmnd *) ptr-host_scribble)
pos = lprint_Scsi_Cmnd(ptr, pos, buffer, length);
spin_unlock_irq(instance-host_lock);

@@ -773,7 +773,7 @@ static int __maybe_unused NCR5380_proc_info(struct 
Scsi_Host *instance,
return length;
 }
 
-static char *lprint_Scsi_Cmnd(Scsi_Cmnd * cmd, char *pos, char *buffer, int 
length)
+static char *lprint_Scsi_Cmnd(struct scsi_cmnd *cmd, char *pos, char *buffer, 
int length)
 {
SPRINTF(scsi%d : destination target %d, lun %d\n, 
cmd-device-host-host_no, cmd-device-id, cmd-device-lun);
SPRINTF(command = );
@@ -952,11 +952,11 @@ static void __devexit NCR5380_exit(struct Scsi_Host 
*instance)
  * Locks: host lock taken by caller
  */
 
-static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) 
+static int NCR5380_queue_command(struct scsi_cmnd *cmd, void (*done) (struct 
scsi_cmnd *))
 {
struct Scsi_Host *instance = cmd-device-host;
struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) 
instance-hostdata;
-   Scsi_Cmnd *tmp;
+   struct scsi_cmnd *tmp;
 
 #if (NDEBUG  NDEBUG_NO_WRITE)
switch (cmd-cmnd[0]) {
@@ -1009,7 +1009,7 @@ static int NCR5380_queue_command(Scsi_Cmnd * cmd, void 
(*done) (Scsi_Cmnd *))
cmd-host_scribble = (unsigned char *) hostdata-issue_queue;
hostdata-issue_queue = cmd;
} else {
-   for (tmp = (Scsi_Cmnd *) hostdata-issue_queue; 
tmp-host_scribble; tmp = (Scsi_Cmnd *) tmp-host_scribble);
+   for (tmp = (struct scsi_cmnd *) hostdata-issue_queue; 
tmp-host_scribble; tmp = (struct scsi_cmnd *) tmp-host_scribble);
LIST(cmd, tmp);
tmp-host_scribble = (unsigned char *) cmd;
}
@@ -1039,7 +1039,7 @@ static void NCR5380_main(struct work_struct *work)
struct NCR5380_hostdata *hostdata =
container_of(work, struct NCR5380_hostdata, coroutine.work);
struct Scsi_Host *instance = hostdata-host;
-   Scsi_Cmnd *tmp, *prev;
+   struct scsi_cmnd *tmp, *prev;
int done;

spin_lock_irq(instance-host_lock);
@@ -1052,7 +1052,7 @@ static void NCR5380_main(struct work_struct *work)
 * Search through the issue_queue for a command destined
 * for a target that's not busy.
 */
-   for (tmp = (Scsi_Cmnd *) hostdata-issue_queue

[PATCH 25/33][SCSI] NCR53c406a: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.
Cleaned up checkpatch.pl-errors (so no ' 80 lines'-warning).


diff --git a/drivers/scsi/NCR53c406a.c b/drivers/scsi/NCR53c406a.c
index 137d065..bdb2ca5 100644
--- a/drivers/scsi/NCR53c406a.c
+++ b/drivers/scsi/NCR53c406a.c
@@ -201,7 +201,7 @@ static int dma_chan;
 static int fast_pio = USE_FAST_PIO;
 #endif
 
-static Scsi_Cmnd *current_SC;
+static struct scsi_cmnd *current_SC;
 static char info_msg[256];
 
 /* = */
@@ -693,7 +693,7 @@ static void wait_intr(void)
 }
 #endif
 
-static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
+static int NCR53c406a_queue(struct scsi_cmnd *SCpnt, void (*done) (struct 
scsi_cmnd *))
 {
int i;
 
@@ -726,7 +726,7 @@ static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) 
(Scsi_Cmnd *))
return 0;
 }
 
-static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt)
+static int NCR53c406a_host_reset(struct scsi_cmnd *SCpnt)
 {
DEB(printk(NCR53c406a_reset called\n));
 
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 27/33][SCSI] nsp32_debug: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.


diff --git a/drivers/scsi/nsp32_debug.c b/drivers/scsi/nsp32_debug.c
index ef3c59c..96cce0b 100644
--- a/drivers/scsi/nsp32_debug.c
+++ b/drivers/scsi/nsp32_debug.c
@@ -137,7 +137,7 @@ static void print_commandk (unsigned char *command)
printk(\n);
 }
 
-static void show_command(Scsi_Cmnd *SCpnt)
+static void show_command(struct scsi_cmnd *SCpnt)
 {
print_commandk(SCpnt-cmnd);
 }
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 29/33][SCSI] pas16: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.


diff --git a/drivers/scsi/pas16.h b/drivers/scsi/pas16.h
index 8dc5b1a..dc87366 100644
--- a/drivers/scsi/pas16.h
+++ b/drivers/scsi/pas16.h
@@ -114,12 +114,12 @@
 
 
 #ifndef ASM
-static int pas16_abort(Scsi_Cmnd *);
+static int pas16_abort(struct scsi_cmnd *);
 static int pas16_biosparam(struct scsi_device *, struct block_device *,
   sector_t, int*);
 static int pas16_detect(struct scsi_host_template *);
-static int pas16_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
-static int pas16_bus_reset(Scsi_Cmnd *);
+static int pas16_queue_command(struct scsi_cmnd *, void (*done)(struct 
scsi_cmnd *));
+static int pas16_bus_reset(struct scsi_cmnd *);
 
 #ifndef CMD_PER_LUN
 #define CMD_PER_LUN 2
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 30/33][SCSI] sun3x_esp: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.
Cleaned up checkpatch.pl-warnings.


diff --git a/drivers/scsi/sun3x_esp.c b/drivers/scsi/sun3x_esp.c
index 1bc4190..8a7d5a4 100644
--- a/drivers/scsi/sun3x_esp.c
+++ b/drivers/scsi/sun3x_esp.c
@@ -25,7 +25,7 @@
 
 static void dma_barrier(struct NCR_ESP *esp);
 static int  dma_bytes_sent(struct NCR_ESP *esp, int fifo_count);
-static int  dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp);
+static int  dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp);
 static void dma_drain(struct NCR_ESP *esp);
 static void dma_invalidate(struct NCR_ESP *esp);
 static void dma_dump_state(struct NCR_ESP *esp);
@@ -38,11 +38,11 @@ static void dma_poll(struct NCR_ESP *esp, unsigned char 
*vaddr);
 static int  dma_ports_p(struct NCR_ESP *esp);
 static void dma_reset(struct NCR_ESP *esp);
 static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write);
-static void dma_mmu_get_scsi_one (struct NCR_ESP *esp, Scsi_Cmnd *sp);
-static void dma_mmu_get_scsi_sgl (struct NCR_ESP *esp, Scsi_Cmnd *sp);
-static void dma_mmu_release_scsi_one (struct NCR_ESP *esp, Scsi_Cmnd *sp);
-static void dma_mmu_release_scsi_sgl (struct NCR_ESP *esp, Scsi_Cmnd *sp);
-static void dma_advance_sg (Scsi_Cmnd *sp);
+static void dma_mmu_get_scsi_one(struct NCR_ESP *esp, struct scsi_cmnd *sp);
+static void dma_mmu_get_scsi_sgl(struct NCR_ESP *esp, struct scsi_cmnd *sp);
+static void dma_mmu_release_scsi_one(struct NCR_ESP *esp, struct scsi_cmnd 
*sp);
+static void dma_mmu_release_scsi_sgl(struct NCR_ESP *esp, struct scsi_cmnd 
*sp);
+static void dma_advance_sg(struct scsi_cmnd *sp);
 
 /* Detecting ESP chips on the machine.  This is the simple and easy
  * version.
@@ -174,7 +174,7 @@ static int dma_bytes_sent(struct NCR_ESP *esp, int 
fifo_count)
return rval - fifo_count;
 }
 
-static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp)
+static int dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
return sp-SCp.this_residual;
 }
@@ -319,14 +319,14 @@ static void dma_setup(struct NCR_ESP *esp, __u32 addr, 
int count, int write)
dregs-st_addr = addr;
 }
 
-static void dma_mmu_get_scsi_one (struct NCR_ESP *esp, Scsi_Cmnd *sp)
+static void dma_mmu_get_scsi_one(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
 sp-SCp.have_data_in = dvma_map((unsigned long)sp-SCp.buffer,
   sp-SCp.this_residual);
 sp-SCp.ptr = (char *)((unsigned long)sp-SCp.have_data_in);
 }
 
-static void dma_mmu_get_scsi_sgl (struct NCR_ESP *esp, Scsi_Cmnd *sp)
+static void dma_mmu_get_scsi_sgl(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
 int sz = sp-SCp.buffers_residual;
 struct scatterlist *sg = sp-SCp.buffer;
@@ -339,12 +339,12 @@ static void dma_mmu_get_scsi_sgl (struct NCR_ESP *esp, 
Scsi_Cmnd *sp)
 sp-SCp.ptr=(char *)((unsigned long)sp-SCp.buffer-dma_address);
 }
 
-static void dma_mmu_release_scsi_one (struct NCR_ESP *esp, Scsi_Cmnd *sp)
+static void dma_mmu_release_scsi_one(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
 dvma_unmap((char *)sp-SCp.have_data_in);
 }
 
-static void dma_mmu_release_scsi_sgl (struct NCR_ESP *esp, Scsi_Cmnd *sp)
+static void dma_mmu_release_scsi_sgl(struct NCR_ESP *esp, struct scsi_cmnd *sp)
 {
 int sz = sp-use_sg - 1;
 struct scatterlist *sg = (struct scatterlist *)sp-request_buffer;
@@ -355,7 +355,7 @@ static void dma_mmu_release_scsi_sgl (struct NCR_ESP *esp, 
Scsi_Cmnd *sp)
 }
 }
 
-static void dma_advance_sg (Scsi_Cmnd *sp)
+static void dma_advance_sg(struct scsi_cmnd *sp)
 {
 sp-SCp.ptr = (char *)((unsigned long)sp-SCp.buffer-dma_address);
 }
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 31/33][SCSI] sym53c416: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.


diff --git a/drivers/scsi/sym53c416.c b/drivers/scsi/sym53c416.c
index 90cee94..689408a 100644
--- a/drivers/scsi/sym53c416.c
+++ b/drivers/scsi/sym53c416.c
@@ -225,7 +225,7 @@ static host hosts[MAXHOSTS] = {
 
 static int host_index = 0;
 static char info[120];
-static Scsi_Cmnd *current_command = NULL;
+static struct scsi_cmnd *current_command = NULL;
 static int fastpio = 1;
 
 static int probeaddrs[] = {0x200, 0x220, 0x240, 0};
@@ -748,7 +748,7 @@ const char *sym53c416_info(struct Scsi_Host *SChost)
return info;
 }
 
-int sym53c416_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
+int sym53c416_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct 
scsi_cmnd *))
 {
int base;
unsigned long flags = 0;
@@ -775,7 +775,7 @@ int sym53c416_queuecommand(Scsi_Cmnd *SCpnt, void 
(*done)(Scsi_Cmnd *))
return 0;
 }
 
-static int sym53c416_host_reset(Scsi_Cmnd *SCpnt)
+static int sym53c416_host_reset(struct scsi_cmnd *SCpnt)
 {
int base;
int scsi_id = -1;   
diff --git a/drivers/scsi/sym53c416.h b/drivers/scsi/sym53c416.h
index 77860d0..a6a89fd 100644
--- a/drivers/scsi/sym53c416.h
+++ b/drivers/scsi/sym53c416.h
@@ -25,8 +25,8 @@
 static int sym53c416_detect(struct scsi_host_template *);
 static const char *sym53c416_info(struct Scsi_Host *);
 static int sym53c416_release(struct Scsi_Host *);
-static int sym53c416_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
-static int sym53c416_host_reset(Scsi_Cmnd *);
+static int sym53c416_queuecommand(struct scsi_cmnd *, void (*done)(struct 
scsi_cmnd *));
+static int sym53c416_host_reset(struct scsi_cmnd *);
 static int sym53c416_bios_param(struct scsi_device *, struct block_device *,
sector_t, int *);
 static void sym53c416_setup(char *str, int *ints);
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/33][SCSI] aha152x: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.
Cleaned up checkpatch.pl-errors (so no ' 80 lines'-warning).


diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index ea8c699..e8eed86 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -460,16 +460,16 @@ enum aha152x_state {
  *
  */
 struct aha152x_hostdata {
-   Scsi_Cmnd *issue_SC;
+   struct scsi_cmnd *issue_SC;
/* pending commands to issue */
 
-   Scsi_Cmnd *current_SC;
+   struct scsi_cmnd *current_SC;
/* current command on the bus */
 
-   Scsi_Cmnd *disconnected_SC;
+   struct scsi_cmnd *disconnected_SC;
/* commands that disconnected */
 
-   Scsi_Cmnd *done_SC;
+   struct scsi_cmnd *done_SC;
/* command that was completed */
 
spinlock_t lock;
@@ -556,7 +556,7 @@ struct aha152x_hostdata {
  *
  */
 struct aha152x_scdata {
-   Scsi_Cmnd *next;/* next sc in queue */
+   struct scsi_cmnd *next; /* next sc in queue */
struct completion *done;/* semaphore to block on */
unsigned char aha_orig_cmd_len;
unsigned char aha_orig_cmnd[MAX_COMMAND_SIZE];
@@ -682,7 +682,7 @@ static void done(struct Scsi_Host *shpnt, int error);
 
 /* diagnostics */
 static void disp_ports(struct Scsi_Host *shpnt);
-static void show_command(Scsi_Cmnd * ptr);
+static void show_command(struct scsi_cmnd *ptr);
 static void show_queues(struct Scsi_Host *shpnt);
 static void disp_enintr(struct Scsi_Host *shpnt);
 
@@ -691,9 +691,9 @@ static void disp_enintr(struct Scsi_Host *shpnt);
  *  queue services:
  *
  */
-static inline void append_SC(Scsi_Cmnd **SC, Scsi_Cmnd *new_SC)
+static inline void append_SC(struct scsi_cmnd **SC, struct scsi_cmnd *new_SC)
 {
-   Scsi_Cmnd *end;
+   struct scsi_cmnd *end;
 
SCNEXT(new_SC) = NULL;
if (!*SC)
@@ -705,9 +705,9 @@ static inline void append_SC(Scsi_Cmnd **SC, Scsi_Cmnd 
*new_SC)
}
 }
 
-static inline Scsi_Cmnd *remove_first_SC(Scsi_Cmnd ** SC)
+static inline struct scsi_cmnd *remove_first_SC(struct scsi_cmnd **SC)
 {
-   Scsi_Cmnd *ptr;
+   struct scsi_cmnd *ptr;
 
ptr = *SC;
if (ptr) {
@@ -717,9 +717,9 @@ static inline Scsi_Cmnd *remove_first_SC(Scsi_Cmnd ** SC)
return ptr;
 }
 
-static inline Scsi_Cmnd *remove_lun_SC(Scsi_Cmnd ** SC, int target, int lun)
+static inline struct scsi_cmnd *remove_lun_SC(struct scsi_cmnd **SC, int 
target, int lun)
 {
-   Scsi_Cmnd *ptr, *prev;
+   struct scsi_cmnd *ptr, *prev;
 
for (ptr = *SC, prev = NULL;
 ptr  ((ptr-device-id != target) || (ptr-device-lun != lun));
@@ -738,9 +738,9 @@ static inline Scsi_Cmnd *remove_lun_SC(Scsi_Cmnd ** SC, int 
target, int lun)
return ptr;
 }
 
-static inline Scsi_Cmnd *remove_SC(Scsi_Cmnd **SC, Scsi_Cmnd *SCp)
+static inline struct scsi_cmnd *remove_SC(struct scsi_cmnd **SC, struct 
scsi_cmnd *SCp)
 {
-   Scsi_Cmnd *ptr, *prev;
+   struct scsi_cmnd *ptr, *prev;
 
for (ptr = *SC, prev = NULL;
 ptr  SCp!=ptr;
@@ -972,8 +972,8 @@ static int setup_expected_interrupts(struct Scsi_Host 
*shpnt)
 /* 
  *  Queue a command and setup interrupts for a free bus.
  */
-static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct completion 
*complete,
-   int phase, void (*done)(Scsi_Cmnd *))
+static int aha152x_internal_queue(struct scsi_cmnd *SCpnt, struct completion 
*complete,
+   int phase, void (*done)(struct scsi_cmnd *))
 {
struct Scsi_Host *shpnt = SCpnt-device-host;
unsigned long flags;
@@ -1062,7 +1062,7 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, 
struct completion *complete,
  *  queue a command
  *
  */
-static int aha152x_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
+static int aha152x_queue(struct scsi_cmnd *SCpnt, void (*done)(struct 
scsi_cmnd *))
 {
 #if 0
if(*SCpnt-cmnd == REQUEST_SENSE) {
@@ -1081,7 +1081,7 @@ static int aha152x_queue(Scsi_Cmnd *SCpnt, void 
(*done)(Scsi_Cmnd *))
  *  
  *
  */
-static void reset_done(Scsi_Cmnd *SCpnt)
+static void reset_done(struct scsi_cmnd *SCpnt)
 {
 #if 0
struct Scsi_Host *shpnt = SCpnt-host;
@@ -1098,10 +1098,10 @@ static void reset_done(Scsi_Cmnd *SCpnt)
  *  Abort a command
  *
  */
-static int aha152x_abort(Scsi_Cmnd *SCpnt)
+static int aha152x_abort(struct scsi_cmnd *SCpnt)
 {
struct Scsi_Host *shpnt = SCpnt-device-host;
-   Scsi_Cmnd *ptr;
+   struct scsi_cmnd *ptr;
unsigned long flags;
 
 #if defined(AHA152X_DEBUG)
@@ -1147,7 +1147,7 @@ static int aha152x_abort(Scsi_Cmnd *SCpnt)
  * Reset a device
  *
  */
-static int aha152x_device_reset(Scsi_Cmnd * SCpnt)
+static int aha152x_device_reset(struct scsi_cmnd *SCpnt)
 {
struct Scsi_Host *shpnt = SCpnt-device-host;
DECLARE_COMPLETION(done

[PATCH 5/33][SCSI] aha1740: Convert 'Scsi_Cmnd' to 'struct scsi_cmnd'

2008-01-05 Thread Richard Knutsson
Convert the typedef'ed 'Scsi_Cmnd' to 'struct scsi_cmnd'.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Last item before 'drivers/scsi/scsi_typedefs.h' can be removed.
Cleaned up checkpatch.pl-errors (so no ' 80 lines'-warning).


diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c
index f6722fd..4fa801f 100644
--- a/drivers/scsi/aha1740.c
+++ b/drivers/scsi/aha1740.c
@@ -226,11 +226,11 @@ static int aha1740_test_port(unsigned int base)
 static irqreturn_t aha1740_intr_handle(int irq, void *dev_id)
 {
struct Scsi_Host *host = (struct Scsi_Host *) dev_id;
-void (*my_done)(Scsi_Cmnd *);
+   void (*my_done)(struct scsi_cmnd *);
int errstatus, adapstat;
int number_serviced;
struct ecb *ecbptr;
-   Scsi_Cmnd *SCtmp;
+   struct scsi_cmnd *SCtmp;
unsigned int base;
unsigned long flags;
int handled = 0;
@@ -330,7 +330,7 @@ static irqreturn_t aha1740_intr_handle(int irq, void 
*dev_id)
return IRQ_RETVAL(handled);
 }
 
-static int aha1740_queuecommand(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *))
+static int aha1740_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct 
scsi_cmnd *))
 {
unchar direction;
unchar *cmd = (unchar *) SCpnt-cmnd;
@@ -537,7 +537,7 @@ static int aha1740_biosparam(struct scsi_device *sdev,
return 0;
 }
 
-static int aha1740_eh_abort_handler (Scsi_Cmnd *dummy)
+static int aha1740_eh_abort_handler (struct scsi_cmnd *dummy)
 {
 /*
  * From Alan Cox :
diff --git a/drivers/scsi/aha1740.h b/drivers/scsi/aha1740.h
index af23fd6..1a3fdf7 100644
--- a/drivers/scsi/aha1740.h
+++ b/drivers/scsi/aha1740.h
@@ -134,8 +134,8 @@ struct ecb {/* Enhanced Control 
Block 6.1 */
 /* Hardware defined portion ends here, rest is driver defined */
u8 sense[MAX_SENSE];/* Sense area */
u8 status[MAX_STATUS];  /* Status area */
-   Scsi_Cmnd *SCpnt;   /* Link to the SCSI Command Block */
-   void (*done) (Scsi_Cmnd *); /* Completion Function */
+   struct scsi_cmnd *SCpnt;/* Link to the SCSI Command Block */
+   void (*done) (struct scsi_cmnd *);  /* Completion Function */
 };
 
 #defineAHA1740CMD_NOP   0x00   /* No OP */
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] drivers/scsi/dpt_i2o: Convert to generic boolean

2007-10-30 Thread Richard Knutsson
Convert to use the generic boolean.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Diffed against linus-git
Checked with script/checkpatch.pl
  (warned about long lines, but it is not introduced by this patch)

 dpt_i2o.c |   22 +++---
 dpti.h|9 ++---
 2 files changed, 13 insertions(+), 18 deletions(-)


diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index 8258506..bd3a82d 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -252,7 +252,7 @@ rebuild_sys_tab:
adpt_i2o_delete_hba(pHba);
continue;
}
-   pHba-initialized = TRUE;
+   pHba-initialized = true;
pHba-state = ~DPTI_STATE_RESET;
scsi_scan_host(pHba-host);
}
@@ -519,7 +519,7 @@ static int adpt_proc_info(struct Scsi_Host *host, char 
*buffer, char **start, of
int unit;
 
*start = buffer;
-   if (inout == TRUE) {
+   if (inout) {
/*
 * The user has done a write and wants us to take the
 * data in the buffer and do something with it.
@@ -893,7 +893,7 @@ static int adpt_install_hba(struct pci_dev* pDev)
void __iomem *base_addr_virt = NULL;
void __iomem *msg_addr_virt = NULL;
 
-   int raptorFlag = FALSE;
+   bool raptorFlag = false;
 
if(pci_enable_device(pDev)) {
return -EINVAL;
@@ -926,7 +926,7 @@ static int adpt_install_hba(struct pci_dev* pDev)
// Use BAR1 in this configuration
base_addr1_phys = pci_resource_start(pDev,1);
hba_map1_area_size = pci_resource_len(pDev,1);
-   raptorFlag = TRUE;
+   raptorFlag = true;
}
 
base_addr_virt = ioremap(base_addr0_phys,hba_map0_area_size);
@@ -936,7 +936,7 @@ static int adpt_install_hba(struct pci_dev* pDev)
return -EINVAL;
}
 
-if(raptorFlag == TRUE) {
+   if (raptorFlag) {
msg_addr_virt = ioremap(base_addr1_phys, hba_map1_area_size );
if (!msg_addr_virt) {
PERROR(dpti: adpt_config_hba: io remap failed on 
BAR1\n);
@@ -996,7 +996,7 @@ static int adpt_install_hba(struct pci_dev* pDev)
spin_lock_init(pHba-state_lock);
spin_lock_init(adpt_post_wait_lock);
 
-   if(raptorFlag == 0){
+   if (!raptorFlag) {
printk(KERN_INFOAdaptec I2O RAID controller %d at %p size=%x 
irq=%d\n, 
hba_count-1, base_addr_virt, hba_map0_area_size, 
pDev-irq);
} else {
@@ -1273,7 +1273,7 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
u32 m = EMPTY_QUEUE ;
ulong timeout = jiffies + (TMOUT_IOPRESET*HZ);
 
-   if(pHba-initialized  == FALSE) {   // First time reset should be 
quick
+   if (!pHba-initialized) {   /* First time reset should be quick */
timeout = jiffies + (25*HZ);
} else {
adpt_i2o_quiesce_hba(pHba);
@@ -1576,7 +1576,7 @@ static int adpt_open(struct inode *inode, struct file 
*file)
 // return -EBUSY;
 // }
 
-   pHba-in_use = 1;
+   pHba-in_use = true;
mutex_unlock(adpt_configuration_lock);
 
return 0;
@@ -1602,7 +1602,7 @@ static int adpt_close(struct inode *inode, struct file 
*file)
return -ENXIO;
}
 
-   pHba-in_use = 0;
+   pHba-in_use = false;
 
return 0;
 }
@@ -2433,8 +2433,8 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba)
pDev-tid = tid;
memcpy(d-lct_data, 
lct-lct_entry[i], sizeof(i2o_lct_entry));
if (pDev-pScsi_dev) {
-   
pDev-pScsi_dev-changed = TRUE;
-   
pDev-pScsi_dev-removable = TRUE;
+   
pDev-pScsi_dev-changed = true;
+   
pDev-pScsi_dev-removable = true;
}
}
// Found it - mark it scanned
diff --git a/drivers/scsi/dpti.h b/drivers/scsi/dpti.h
index 0892f6c..5eb7274 100644
--- a/drivers/scsi/dpti.h
+++ b/drivers/scsi/dpti.h
@@ -155,11 +155,6 @@ static int adpt_device_reset(struct scsi_cmnd* cmd);
 #define I2O_SCSI_DSC_QUEUE_FROZEN   0x4000
 
 
-#ifndef TRUE
-#define TRUE  1
-#define FALSE 0
-#endif
-
 #define HBA_FLAGS_INSTALLED_B   0x0001 // Adapter Was Installed
 #define HBA_FLAGS_BLINKLED_B0x0002 // Adapter In Blink LED State
 #define HBA_FLAGS_IN_RESET 0x0040  /* in reset */
@@ -209,8 +204,8 @@ typedef struct _adpt_hba {
spinlock_t state_lock

Re: [PATCH] drivers/scsi/dpt_i2o: Convert to generic boolean

2007-10-30 Thread Richard Knutsson

Matthew Wilcox wrote:

On Tue, Oct 30, 2007 at 11:54:22AM +0100, Richard Knutsson wrote:
  

Convert to use the generic boolean.
-   u8 initialized;
-   u8 in_use;  /* is the management node open*/
+   bool initialized:8;
+   bool in_use:8;  /* is the management node open*/



Are you serious?
  
Well, yes. It is since it was defined to really be 8 bits before, and 
there is no reason why a boolean would be 8 bits and not 1 or 16.

If it is overly cautious/not needed, then I don't mind removing the ':8'...

Richard Knutsson


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] drivers/scsi/dpt_i2o: Convert to generic boolean

2007-10-30 Thread Richard Knutsson

Matthew Wilcox wrote:

On Tue, Oct 30, 2007 at 05:46:08PM +0100, Richard Knutsson wrote:
  
I just don't see the reason why expressing a boolean as an integer. Some 
advantage?



This is C, not Java, or some other highly-typed language.
if (int) and if (ptr) are perfectly acceptable in C.
  
Yes, and it has been corrected in the C99-standard (which we are using 
since the Linux support for the the 2.95 compiler stopped). Is there 
something wrong in actually typing the variable to the type we want it 
to be? Or would it be better to regress (becoming like Perl or PHP)[1][2]?
Btw, I am all for 'if (ptr)' since it rarely (if ever) makes any sense 
to do 'if (ptr == 0x1234)', which evaluates to ptr == NULL is invalid 
and otherwise valid. Is it really the same for integers? ;)
(also just want to add: to the this is not a highly-typed language 
that I have heard many times, it theory, I think it would suffice with 
just the void-pointer)
  
(also helps us if someone does: 'if (var == true)', even thou we should 
try to avoid them)



I have no idea what you mean.
  
There is some places where things like 'if (var == true)' is done, but 
what happens when var is not the same number as 'true' (and still != 0)? 
It is a potential bug if 'var' is an integer and expected to be a 
boolean in this case. Like in a case of var = some_var  some_flag;


Best regards
Richard Knutsson
[1] Nothing wrong with Perl or PHP, they are suited for the tasks they 
are meant to solve.

[2] If I recall correctly, the predecessor 'B' did not have any types.
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] drivers/scsi/aic7xxx_old: Convert to generic boolean

2007-05-10 Thread Richard Knutsson
Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Compile-tested with all(yes|mod|no)config on x86(|_64)  sparc(|64)
  got some warnings on some builds, none related to this patch
Diffed against Linus' git-tree.

 aic7xxx_old.c  |  326 ++---
 aic7xxx_old/aic7xxx_proc.c |2
 2 files changed, 161 insertions(+), 167 deletions(-)


diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c
index a988d5a..afa5ded 100644
--- a/drivers/scsi/aic7xxx_old.c
+++ b/drivers/scsi/aic7xxx_old.c
@@ -255,12 +255,6 @@
 #define ALL_LUNS -1
 #define MAX_TARGETS  16
 #define MAX_LUNS 8
-#ifndef TRUE
-#  define TRUE 1
-#endif
-#ifndef FALSE
-#  define FALSE 0
-#endif
 
 #if defined(__powerpc__) || defined(__i386__) || defined(__x86_64__)
 #  define MMAPIO
@@ -1382,7 +1376,7 @@ aic7xxx_setup(char *s)
 char *tok, *tok_end, *tok_end2;
 char tok_list[] = { '.', ',', '{', '}', '\0' };
 int i, instance = -1, device = -1;
-unsigned char done = FALSE;
+bool done = false;
 
 base = p;
 tok = base + n + 1;  /* Forward us just past the ':' */
@@ -1410,14 +1404,14 @@ aic7xxx_setup(char *s)
 case ',':
 case '.':
   if (instance == -1)
-done = TRUE;
+done = true;
   else if (device = 0)
 device++;
   else if (instance = 0)
 instance++;
   if ( (device = MAX_TARGETS) || 
(instance = ARRAY_SIZE(aic7xxx_tag_info)) )
-done = TRUE;
+done = true;
   tok++;
   if (!done)
   {
@@ -1425,10 +1419,10 @@ aic7xxx_setup(char *s)
   }
   break;
 case '\0':
-  done = TRUE;
+  done = true;
   break;
 default:
-  done = TRUE;
+  done = true;
   tok_end = strchr(tok, '\0');
   for(i=0; tok_list[i]; i++)
   {
@@ -1436,7 +1430,7 @@ aic7xxx_setup(char *s)
 if ( (tok_end2)  (tok_end2  tok_end) )
 {
   tok_end = tok_end2;
-  done = FALSE;
+  done = false;
 }
   }
   if ( (instance = 0)  (device = 0) 
@@ -1512,7 +1506,7 @@ pause_sequencer(struct aic7xxx_host *p)
  *   warrant an easy way to do it.
  *-F*/
 static void
-unpause_sequencer(struct aic7xxx_host *p, int unpause_always)
+unpause_sequencer(struct aic7xxx_host *p, bool unpause_always)
 {
   if (unpause_always ||
   ( !(aic_inb(p, INTSTAT)  (SCSIINT | SEQINT | BRKADRINT)) 
@@ -1771,7 +1765,7 @@ aic7xxx_loadseq(struct aic7xxx_host *p)
   aic_outb(p, 0, SEQADDR0);
   aic_outb(p, 0, SEQADDR1);
   aic_outb(p, FASTMODE | FAILDIS, SEQCTL);
-  unpause_sequencer(p, TRUE);
+  unpause_sequencer(p, true);
   mdelay(1);
   pause_sequencer(p);
   aic_outb(p, FASTMODE, SEQCTL);
@@ -1820,7 +1814,7 @@ aic7xxx_print_sequencer(struct aic7xxx_host *p, int 
downloaded)
   aic_outb(p, 0, SEQADDR0);
   aic_outb(p, 0, SEQADDR1);
   aic_outb(p, FASTMODE | FAILDIS, SEQCTL);
-  unpause_sequencer(p, TRUE);
+  unpause_sequencer(p, true);
   mdelay(1);
   pause_sequencer(p);
   aic_outb(p, FASTMODE, SEQCTL);
@@ -1868,7 +1862,7 @@ aic7xxx_find_syncrate(struct aic7xxx_host *p, unsigned 
int *period,
   unsigned int maxsync, unsigned char *options)
 {
   struct aic7xxx_syncrate *syncrate;
-  int done = FALSE;
+  bool done = false;
 
   switch(*options)
   {
@@ -1924,7 +1918,7 @@ aic7xxx_find_syncrate(struct aic7xxx_host *p, unsigned 
int *period,
 case MSG_EXT_PPR_OPTION_DT_UNITS:
   if(!(syncrate-sxfr_ultra2  AHC_SYNCRATE_CRC))
   {
-done = TRUE;
+done = true;
 /*
  * oops, we went too low for the CRC/DualEdge signalling, so
  * clear the options byte
@@ -1938,7 +1932,7 @@ aic7xxx_find_syncrate(struct aic7xxx_host *p, unsigned 
int *period,
   }
   else
   {
-done = TRUE;
+done = true;
 if(syncrate == aic7xxx_syncrates[maxsync])
 {
   *period = syncrate-period;
@@ -1948,7 +1942,7 @@ aic7xxx_find_syncrate(struct aic7xxx_host *p, unsigned 
int *period,
 default:
   if(!(syncrate-sxfr_ultra2  AHC_SYNCRATE_CRC))
   {
-done = TRUE;
+done = true;
 if(syncrate == aic7xxx_syncrates[maxsync])
 {
   *period = syncrate-period;
@@ -2375,22 +2369,22 @@ scbq_insert_tail(volatile scb_queue_type *queue, struct 
aic7xxx_scb *scb)
  *   on the specified channel

Re: [patch 16/30] drivers/scsi/aic7xxx_old: Convert to generic boolean-values

2007-05-07 Thread Richard Knutsson

Andrew Morton wrote:

On Mon, 7 May 2007 14:06:56 -0700
Andrew Morton [EMAIL PROTECTED] wrote:

  

so I'll drop it on those grounds, not on the bogus ones.



However it will come back again.  All subsystem-private implementations
of TRUE and FALSE are in the firing line now.
  

Amen.
But should we let it rest until most of the other (boolean) conversions 
are done (as with CIFS and XFS (iirc)), otherwise I can take a new stab 
at it this weekend.


Btw Andrew, do you want me to Cc: you all the patches or should I 
continue to first send them to (hopefully the correct) maintainer(s)/ML, 
and send them your way if they are not picked up (is one week enough, or 
should it be longer?)


Regards
Richard Knutsson

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] drivers/scsi/pci2000.h: Remove unused file

2007-05-01 Thread Richard Knutsson
Remove the unused header drivers/scsi/pci2000.h

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
'grep -nr pci2000' on the whole tree results only in a reference to pci2000.h
Diffed against Linus' git-tree.


diff --git a/drivers/scsi/pci2000.h b/drivers/scsi/pci2000.h
deleted file mode 100644
index 0ebd8ce..000
--- a/drivers/scsi/pci2000.h
+++ /dev/null
@@ -1,197 +0,0 @@
-/
- * Perceptive Solutions, Inc. PCI-2000 device driver for Linux.
- *
- * pci2000.h - Linux Host Driver for PCI-2000 IntelliCache SCSI Adapters
- *
- * Copyright (c) 1997-1999 Perceptive Solutions, Inc.
- * All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that redistributions of source
- * code retain the above copyright notice and this comment without
- * modification.
- *
- * Technical updates and product information at:
- *  http://www.psidisk.com
- *
- * Please send questions, comments, bug reports to:
- *  [EMAIL PROTECTED] Technical Support
- *
- /
-#ifndef _PCI2000_H
-#define _PCI2000_H
-
-#include linux/types.h
-
-#ifndefPSI_EIDE_SCSIOP
-#definePSI_EIDE_SCSIOP 1
-
-#defineLINUXVERSION(v,p,s)(((v)16) + ((p)8) + (s))
-
-//
-/* definition of standard data types   */
-//
-#defineCHARchar
-#defineUCHAR   unsigned char
-#defineSHORT   short
-#defineUSHORT  unsigned short
-#defineBOOLlong
-#defineLONGlong
-#defineULONG   unsigned long
-#defineVOIDvoid
-
-typedefCHAR*PCHAR;
-typedefUCHAR   *PUCHAR;
-typedefSHORT   *PSHORT;
-typedefUSHORT  *PUSHORT;
-typedefBOOL*PBOOL;
-typedefLONG*PLONG;
-typedefULONG   *PULONG;
-typedefVOID*PVOID;
-
-
-//
-/* Misc. macros
*/
-//
-#define ANY2SCSI(up, p)\
-((UCHAR *)up)[0] = (((ULONG)(p))  8);\
-((UCHAR *)up)[1] = ((ULONG)(p));
-
-#define SCSI2LONG(up)  \
-( (((long)*(((UCHAR *)up)))  16) \
-+ (((long)(((UCHAR *)up)[1]))  8)\
-+ ((long)(((UCHAR *)up)[2])) )
-
-#define XANY2SCSI(up, p)   \
-((UCHAR *)up)[0] = ((long)(p))  24;  \
-((UCHAR *)up)[1] = ((long)(p))  16;  \
-((UCHAR *)up)[2] = ((long)(p))  8;   \
-((UCHAR *)up)[3] = ((long)(p));
-
-#define XSCSI2LONG(up) \
-( (((long)(((UCHAR *)up)[0]))  24)   \
-+ (((long)(((UCHAR *)up)[1]))  16)   \
-+ (((long)(((UCHAR *)up)[2]))   8)   \
-+ ((long)(((UCHAR *)up)[3])) )
-
-//
-/* SCSI CDB operation codes*/
-//
-#define SCSIOP_TEST_UNIT_READY 0x00
-#define SCSIOP_REZERO_UNIT 0x01
-#define SCSIOP_REWIND  0x01
-#define SCSIOP_REQUEST_BLOCK_ADDR  0x02
-#define SCSIOP_REQUEST_SENSE   0x03
-#define SCSIOP_FORMAT_UNIT 0x04
-#define SCSIOP_READ_BLOCK_LIMITS   0x05
-#define SCSIOP_REASSIGN_BLOCKS 0x07
-#define SCSIOP_READ6   0x08
-#define SCSIOP_RECEIVE 0x08
-#define SCSIOP_WRITE6  0x0A
-#define SCSIOP_PRINT   0x0A
-#define SCSIOP_SEND0x0A
-#define SCSIOP_SEEK6   0x0B
-#define SCSIOP_TRACK_SELECT0x0B
-#define SCSIOP_SLEW_PRINT  0x0B
-#define SCSIOP_SEEK_BLOCK  0x0C
-#define SCSIOP_PARTITION   0x0D
-#define SCSIOP_READ_REVERSE0x0F
-#define SCSIOP_WRITE_FILEMARKS 0x10
-#define SCSIOP_FLUSH_BUFFER0x10
-#define SCSIOP_SPACE   0x11
-#define SCSIOP_INQUIRY 0x12
-#define SCSIOP_VERIFY6 0x13
-#define SCSIOP_RECOVER_BUF_DATA0x14
-#define SCSIOP_MODE_SELECT 0x15
-#define SCSIOP_RESERVE_UNIT0x16
-#define SCSIOP_RELEASE_UNIT0x17
-#define SCSIOP_COPY0x18
-#define SCSIOP_ERASE   0x19
-#define SCSIOP_MODE_SENSE  0x1A
-#define SCSIOP_START_STOP_UNIT 0x1B
-#define SCSIOP_STOP_PRINT  0x1B
-#define SCSIOP_LOAD_UNLOAD 0x1B
-#define

Re: [PATCH] drivers/scsi/pci2000.h: Remove unused file

2007-05-01 Thread Richard Knutsson

James Bottomley wrote:

On Tue, 2007-05-01 at 14:16 -0400, Robert P. J. Day wrote:
  

On Tue, 1 May 2007, Richard Knutsson wrote:



Remove the unused header drivers/scsi/pci2000.h
  

i have the same patch in my pending patch directory, dated march 10,
so i know i submitted it, but i have no idea whatever happened to it.



It's in -mm via this, pending merge with linus:

http://git.kernel.org/?p=linux/kernel/git/jejb/scsi-misc-2.6.git;a=commit;h=38891cb6b0de3f5986e6a7688c5ae17c18b000a9
  

Ok, thanks.

Richard Knutsson

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] drivers/scsi/eata_generic.h: Remove FALSE/TRUE defines

2007-03-17 Thread Richard Knutsson
Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Only included by drivers/scsi/eata_pio.c and it only uses FALSE/TRUE
in comments.


diff --git a/drivers/scsi/eata_generic.h b/drivers/scsi/eata_generic.h
index 635c148..5016af5 100644
--- a/drivers/scsi/eata_generic.h
+++ b/drivers/scsi/eata_generic.h
@@ -18,13 +18,6 @@
  * Misc. definitions*
  */
 
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
 #define R_LIMIT 0x2
 
 #define MAXISA4
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] drivers/scsi/aic7xxx_old: Convert to generic boolean-values

2007-02-16 Thread Richard Knutsson

James Bottomley wrote:

On Fri, 2007-02-16 at 19:04 +0100, Richard Knutsson wrote:
  

James Bottomley wrote:


On Mon, 2007-02-12 at 12:27 -0800, Andrew Morton wrote:
  
  

Given that we now have a standard kernel-wide, c99-friendly way of
expressing true and false, I'd suggest that this decision can be revisited.

Because a true is significantly more meaningful (and hence readable)
thing than a bare 1.



OK, I'm really not happy with doing this for three reasons:

1. It's inviting huge amounts of driver churn changing bitfields to
booleans
  
  

Have been some work done already. Has there been any problems?



There's always an issue when two people work on the same driver ... it
causes patch conflicts, which is why we try to avoid it where we can.
  

But it is (hopefully) a one-time change.

2. I do find it to be a readability issue.  Like most driver writers,
I'm used to register layouts, and those are simple bitfields, so I don't
tend to think true and false, I think 1 and 0.
  
  
It is a fundamental difference between an integer and a boolean. Have 
you seen anyone trying to do bool var = true + true;? ;)



I don't quite see how this is relevant to the readability issue?
  

Your simple bitfields :)
But on the note of readability; there is in no way any constraints to 
only use 'false'/'true'. Right now I'm converting some files who already 
uses FALSE/TRUE and may change 0/1 for consitency.
But I think it all boils down to what people are used to (I don't think 
there are any C++/Java-developers who complains about boolean and 
false/true). I am not too concerned about 0/1 being used or false/true, 
but the proper use of booleans and values.
  

3. Having a different, special, type for single bit bitfields (while
still using un for multi bit bitfields) is asking for confusion, and
hence trouble at the driver level.
  
  

I don't think a boolean should be view as a single bit bitfield. Ex:
u8 a:1;
...
int b = 4 + a;
is obviously not a boolean, while:
u8 a:1;
...
if (a)
is, and a should be bool a:1; (imho)



This again, doesn't really address the argument.  I'm saying I'd rather
not have confusion over what types to use in the driver.  You're saying
that if you only check the value for truth or falsehood it should be a
boolean.  That's actually worse than I was anticipating because you're
now saying that single bit bitfields may or may not be booleans
depending on use.  This looks like worse potential for confusion than
before.
  

Actually I find it to be simpler. Which would you chose?:
u8 a:1;
or
int a:1;
for a value? But if 'a' is a statement, then we just use:
bool a:1 (if the size of the variable is of relevance, otherwise just 
bool a). (You know what the variables are going to be used for when 
declaring them, right??)
Btw, how do you know if a += 1 is just used to flip 'a's value or if 
it is a bug (in the case of boolean)?


Richard come over to the dark side Knutsson

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/6] scsi: megaraid_sas - throttle io if FW is busy

2007-02-15 Thread Richard Knutsson

Sumant Patro wrote:

Checks added in megasas_queue_command to know if FW is able to process
commands within the timeout period. If number of retries is 2 or more,
the driver stops sending cmd to FW. IO is resumed when pending cmd count 
reduces to 16 or 10 seconds has elapsed from the time cmds were last 
sent to FW.


Signed-off-by: Sumant Patro [EMAIL PROTECTED]
---

 drivers/scsi/megaraid/megaraid_sas.c |   27 +
 drivers/scsi/megaraid/megaraid_sas.h |3 ++
 2 files changed, 30 insertions(+)

  

[snip]

diff -uprN linux-feb13-new-p2/drivers/scsi/megaraid/megaraid_sas.h 
linux-feb13-new-p3/drivers/scsi/megaraid/megaraid_sas.h
--- linux-feb13-new-p2/drivers/scsi/megaraid/megaraid_sas.h 2007-02-13 
07:22:40.0 -0800
+++ linux-feb13-new-p3/drivers/scsi/megaraid/megaraid_sas.h 2007-02-13 
11:37:09.0 -0800
@@ -1102,6 +1102,9 @@ struct megasas_instance {
atomic_t fw_outstanding;
u32 hw_crit_error;
 
+	u8 is_busy;
  
Why not bool is_busy:8;? It obviously is a boolean. I would also think 
false/true would be more descriptive then 0/1.


Richard Knutsson

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] scsi/megaraid.c: pci_module_init to pci_register_driver

2007-02-13 Thread Richard Knutsson
Convert pci_module_init() to pci_register_driver().

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Compile-tested with allyes, allmod  allno on i386


diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 808a1b8..0aa3304 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -5072,7 +5072,7 @@ static int __init megaraid_init(void)
megaraid: failed to create megaraid root\n);
}
 #endif
-   error = pci_module_init(megaraid_pci_driver);
+   error = pci_register_driver(megaraid_pci_driver);
if (error) {
 #ifdef CONFIG_PROC_FS
remove_proc_entry(megaraid, proc_root);
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] scsi/tmscsim.c: pci_module_init to pci_register_driver

2007-02-13 Thread Richard Knutsson
Convert pci_module_init() to pci_register_driver().

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
Compile-tested with allyes, allmod  allno on i386


diff --git a/drivers/scsi/tmscsim.c b/drivers/scsi/tmscsim.c
index fa5382e..ce8845e 100644
--- a/drivers/scsi/tmscsim.c
+++ b/drivers/scsi/tmscsim.c
@@ -2681,7 +2681,7 @@ static int __init dc390_module_init(void)
printk (KERN_INFO DC390: Using safe settings.\n);
}
 
-   return pci_module_init(dc390_driver);
+   return pci_register_driver(dc390_driver);
 }
 
 static void __exit dc390_module_exit(void)
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] drivers/scsi/aic7xxx_old: Convert to generic boolean-values

2007-02-10 Thread Richard Knutsson

James Bottomley wrote:

On Sat, 2007-02-10 at 18:46 +0100, Richard Knutsson wrote:
  

Convert:
FALSE - false
TRUE  - true



Actually, downcasing true and false in this driver is pretty much a
retrograde step.  The reason for their being uppercased is that they
represent constants (and uppercase is the traditional defined constant
specifier).

When discussion about TRUE and FALSE came up a long time a go in the
context of the mid layer we agreed to strip the defined constants out of
that code and just go with 1 and 0 inline ... because the code was
pretty much being rewritten.  We also decided to encourage but not force
the driver writers simply to use 1 and 0 as well ... a lot of people are
deeply wedded to the TRUE and FALSE defines, it turned out.
  
Btw, is this just for aic7xxx_old and not aic7xxx? Is it going to be 
replaced? In that case, I will just leave it alone.


Richard Knutsson

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] megaraid.c: Convert pci_module_init() to pci_register_driver()

2007-01-12 Thread Richard Knutsson

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
---
PS
The mailing-list is marked as S: instead of L:
DS

diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 77d9d38..4fd4960 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -5072,7 +5072,7 @@ static int __init megaraid_init(void)
megaraid: failed to create megaraid root\n);
}
#endif
-   error = pci_module_init(megaraid_pci_driver);
+   error = pci_register_driver(megaraid_pci_driver);
if (error) {
#ifdef CONFIG_PROC_FS
remove_proc_entry(megaraid, proc_root);


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html