aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sym53c8xx_2
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-06-03 07:21:13 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-06 11:07:25 -0400
commit5d5ff44fe6775ccb922fd1f7d478b2ba9ca95068 (patch)
treed8569caefe1cb5ecced30929ef98d3e1fe642425 /drivers/scsi/sym53c8xx_2
parente4a082c7c1f9a7b11fece6918e7ee5519b39ac46 (diff)
[SCSI] fix up request buffer reference in various scsi drivers
Various scsi drivers use scsi_cmnd.buffer and scsi_cmnd.bufflen in their queuecommand functions. Those fields are internal storage for the midlayer only and are used to restore the original payload after request_buffer and request_bufflen have been overwritten for EH. Using the buffer and bufflen fields means they do very broken things in error handling. Signed-off-by: Christoph Hellwig <hch@lst.de> 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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
index 9c83b4d39a26..ee081320e1f1 100644
--- a/drivers/scsi/sym53c8xx_2/sym_glue.c
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
@@ -156,7 +156,7 @@ static void __unmap_scsi_data(struct pci_dev *pdev, struct scsi_cmnd *cmd)
156 156
157 switch(SYM_UCMD_PTR(cmd)->data_mapped) { 157 switch(SYM_UCMD_PTR(cmd)->data_mapped) {
158 case 2: 158 case 2:
159 pci_unmap_sg(pdev, cmd->buffer, cmd->use_sg, dma_dir); 159 pci_unmap_sg(pdev, cmd->request_buffer, cmd->use_sg, dma_dir);
160 break; 160 break;
161 case 1: 161 case 1:
162 pci_unmap_single(pdev, SYM_UCMD_PTR(cmd)->data_mapping, 162 pci_unmap_single(pdev, SYM_UCMD_PTR(cmd)->data_mapping,
@@ -186,7 +186,7 @@ static int __map_scsi_sg_data(struct pci_dev *pdev, struct scsi_cmnd *cmd)
186 int use_sg; 186 int use_sg;
187 int dma_dir = cmd->sc_data_direction; 187 int dma_dir = cmd->sc_data_direction;
188 188
189 use_sg = pci_map_sg(pdev, cmd->buffer, cmd->use_sg, dma_dir); 189 use_sg = pci_map_sg(pdev, cmd->request_buffer, cmd->use_sg, dma_dir);
190 if (use_sg > 0) { 190 if (use_sg > 0) {
191 SYM_UCMD_PTR(cmd)->data_mapped = 2; 191 SYM_UCMD_PTR(cmd)->data_mapped = 2;
192 SYM_UCMD_PTR(cmd)->data_mapping = use_sg; 192 SYM_UCMD_PTR(cmd)->data_mapping = use_sg;
@@ -376,7 +376,7 @@ static int sym_scatter(struct sym_hcb *np, struct sym_ccb *cp, struct scsi_cmnd
376 if (!use_sg) 376 if (!use_sg)
377 segment = sym_scatter_no_sglist(np, cp, cmd); 377 segment = sym_scatter_no_sglist(np, cp, cmd);
378 else if ((use_sg = map_scsi_sg_data(np, cmd)) > 0) { 378 else if ((use_sg = map_scsi_sg_data(np, cmd)) > 0) {
379 struct scatterlist *scatter = (struct scatterlist *)cmd->buffer; 379 struct scatterlist *scatter = (struct scatterlist *)cmd->request_buffer;
380 struct sym_tcb *tp = &np->target[cp->target]; 380 struct sym_tcb *tp = &np->target[cp->target];
381 struct sym_tblmove *data; 381 struct sym_tblmove *data;
382 382