aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sym53c8xx_2
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2007-10-05 15:55:00 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-10-23 15:08:26 -0400
commit39c05d1e3c85c725e140ded1281bbb2303dfe5d3 (patch)
tree527e435eba64d6705fc6082434dd5176f0532355 /drivers/scsi/sym53c8xx_2
parentf363abff55cad0e9c6e73c4eedae13d9ee794880 (diff)
[SCSI] sym53c8xx: Remove data_mapping and data_mapped
Before all commands used sg, data_mapping and data_mapped were used to distinguish whether the command had used map_single or map_sg. Now all commands are sg, so we can delete data_mapping, data_mapped and the wrapper functions __unmap_scsi_data, __map_scsi_sg_data, unmap_scsi_data and map_scsi_sg_data. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/sym53c8xx_2')
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_glue.c33
1 files changed, 3 insertions, 30 deletions
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
index e053222a10a3..cfce00ba2b6e 100644
--- a/drivers/scsi/sym53c8xx_2/sym_glue.c
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
@@ -134,8 +134,6 @@ static struct scsi_transport_template *sym2_transport_template = NULL;
134 * Driver private area in the SCSI command structure. 134 * Driver private area in the SCSI command structure.
135 */ 135 */
136struct sym_ucmd { /* Override the SCSI pointer structure */ 136struct sym_ucmd { /* Override the SCSI pointer structure */
137 dma_addr_t data_mapping;
138 unsigned char data_mapped;
139 unsigned char to_do; /* For error handling */ 137 unsigned char to_do; /* For error handling */
140 void (*old_done)(struct scsi_cmnd *); /* For error handling */ 138 void (*old_done)(struct scsi_cmnd *); /* For error handling */
141 struct completion *eh_done; /* For error handling */ 139 struct completion *eh_done; /* For error handling */
@@ -144,37 +142,12 @@ struct sym_ucmd { /* Override the SCSI pointer structure */
144#define SYM_UCMD_PTR(cmd) ((struct sym_ucmd *)(&(cmd)->SCp)) 142#define SYM_UCMD_PTR(cmd) ((struct sym_ucmd *)(&(cmd)->SCp))
145#define SYM_SOFTC_PTR(cmd) sym_get_hcb(cmd->device->host) 143#define SYM_SOFTC_PTR(cmd) sym_get_hcb(cmd->device->host)
146 144
147static void __unmap_scsi_data(struct pci_dev *pdev, struct scsi_cmnd *cmd)
148{
149 if (SYM_UCMD_PTR(cmd)->data_mapped)
150 scsi_dma_unmap(cmd);
151
152 SYM_UCMD_PTR(cmd)->data_mapped = 0;
153}
154
155static int __map_scsi_sg_data(struct pci_dev *pdev, struct scsi_cmnd *cmd)
156{
157 int use_sg;
158
159 use_sg = scsi_dma_map(cmd);
160 if (use_sg > 0) {
161 SYM_UCMD_PTR(cmd)->data_mapped = 2;
162 SYM_UCMD_PTR(cmd)->data_mapping = use_sg;
163 }
164
165 return use_sg;
166}
167
168#define unmap_scsi_data(np, cmd) \
169 __unmap_scsi_data(np->s.device, cmd)
170#define map_scsi_sg_data(np, cmd) \
171 __map_scsi_sg_data(np->s.device, cmd)
172/* 145/*
173 * Complete a pending CAM CCB. 146 * Complete a pending CAM CCB.
174 */ 147 */
175void sym_xpt_done(struct sym_hcb *np, struct scsi_cmnd *cmd) 148void sym_xpt_done(struct sym_hcb *np, struct scsi_cmnd *cmd)
176{ 149{
177 unmap_scsi_data(np, cmd); 150 scsi_dma_unmap(cmd);
178 cmd->scsi_done(cmd); 151 cmd->scsi_done(cmd);
179} 152}
180 153
@@ -307,14 +280,14 @@ static int sym_scatter(struct sym_hcb *np, struct sym_ccb *cp, struct scsi_cmnd
307 280
308 cp->data_len = 0; 281 cp->data_len = 0;
309 282
310 use_sg = map_scsi_sg_data(np, cmd); 283 use_sg = scsi_dma_map(cmd);
311 if (use_sg > 0) { 284 if (use_sg > 0) {
312 struct scatterlist *sg; 285 struct scatterlist *sg;
313 struct sym_tcb *tp = &np->target[cp->target]; 286 struct sym_tcb *tp = &np->target[cp->target];
314 struct sym_tblmove *data; 287 struct sym_tblmove *data;
315 288
316 if (use_sg > SYM_CONF_MAX_SG) { 289 if (use_sg > SYM_CONF_MAX_SG) {
317 unmap_scsi_data(np, cmd); 290 scsi_dma_unmap(cmd);
318 return -1; 291 return -1;
319 } 292 }
320 293