aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2007-09-09 13:57:05 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-11 19:22:35 -0500
commitf2c1afa5ebc6cd3171539e686b48a2afe24694c0 (patch)
treeaf33697c4a09bddf98b52544d8a49f0fede31b64 /drivers
parent7410d849a47047f1299a505dd5fde68d0ed45eaa (diff)
[SCSI] a2091: convert to accessors and !use_sg cleanup
- convert to accessors and !use_sg cleanup Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/a2091.c36
1 files changed, 5 insertions, 31 deletions
diff --git a/drivers/scsi/a2091.c b/drivers/scsi/a2091.c
index b7c5385e2efe..23f27c9c9895 100644
--- a/drivers/scsi/a2091.c
+++ b/drivers/scsi/a2091.c
@@ -73,18 +73,9 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
73 } 73 }
74 74
75 if (!dir_in) { 75 if (!dir_in) {
76 /* copy to bounce buffer for a write */ 76 /* copy to bounce buffer for a write */
77 if (cmd->use_sg)
78#if 0
79 panic ("scsi%ddma: incomplete s/g support",
80 instance->host_no);
81#else
82 memcpy (HDATA(instance)->dma_bounce_buffer, 77 memcpy (HDATA(instance)->dma_bounce_buffer,
83 cmd->SCp.ptr, cmd->SCp.this_residual); 78 cmd->SCp.ptr, cmd->SCp.this_residual);
84#endif
85 else
86 memcpy (HDATA(instance)->dma_bounce_buffer,
87 cmd->request_buffer, cmd->request_bufflen);
88 } 79 }
89 } 80 }
90 81
@@ -144,30 +135,13 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
144 135
145 /* copy from a bounce buffer, if necessary */ 136 /* copy from a bounce buffer, if necessary */
146 if (status && HDATA(instance)->dma_bounce_buffer) { 137 if (status && HDATA(instance)->dma_bounce_buffer) {
147 if (SCpnt && SCpnt->use_sg) { 138 if( HDATA(instance)->dma_dir )
148#if 0
149 panic ("scsi%d: incomplete s/g support",
150 instance->host_no);
151#else
152 if( HDATA(instance)->dma_dir )
153 memcpy (SCpnt->SCp.ptr, 139 memcpy (SCpnt->SCp.ptr,
154 HDATA(instance)->dma_bounce_buffer, 140 HDATA(instance)->dma_bounce_buffer,
155 SCpnt->SCp.this_residual); 141 SCpnt->SCp.this_residual);
156 kfree (HDATA(instance)->dma_bounce_buffer); 142 kfree (HDATA(instance)->dma_bounce_buffer);
157 HDATA(instance)->dma_bounce_buffer = NULL; 143 HDATA(instance)->dma_bounce_buffer = NULL;
158 HDATA(instance)->dma_bounce_len = 0; 144 HDATA(instance)->dma_bounce_len = 0;
159
160#endif
161 } else {
162 if (HDATA(instance)->dma_dir && SCpnt)
163 memcpy (SCpnt->request_buffer,
164 HDATA(instance)->dma_bounce_buffer,
165 SCpnt->request_bufflen);
166
167 kfree (HDATA(instance)->dma_bounce_buffer);
168 HDATA(instance)->dma_bounce_buffer = NULL;
169 HDATA(instance)->dma_bounce_len = 0;
170 }
171 } 145 }
172} 146}
173 147