aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2007-09-09 13:47:26 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-11 19:22:36 -0500
commit41c2497b188a641c542328d08a45cf3214d453bd (patch)
tree31ca9b40b714bbe43e5c814090bf280834c43eb2 /drivers/usb
parentdd829d2302c6b0f88542ca367229d676cb9ca212 (diff)
[SCSI] usb: freecom & sddr09 - convert to accessors and !use_sg cleanup
- Use scsi data accessors and remove of !use_sg code path - This patch is dependent on cleanup patch to usb transport.c/h Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Acked-by: Matthew Dharm <mdharm-scsi@one-eyed-alien.net> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/storage/freecom.c14
-rw-r--r--drivers/usb/storage/sddr09.c9
2 files changed, 9 insertions, 14 deletions
diff --git a/drivers/usb/storage/freecom.c b/drivers/usb/storage/freecom.c
index 88aa59ab7563..f5a4e8d6a3b1 100644
--- a/drivers/usb/storage/freecom.c
+++ b/drivers/usb/storage/freecom.c
@@ -132,8 +132,7 @@ freecom_readdata (struct scsi_cmnd *srb, struct us_data *us,
132 132
133 /* Now transfer all of our blocks. */ 133 /* Now transfer all of our blocks. */
134 US_DEBUGP("Start of read\n"); 134 US_DEBUGP("Start of read\n");
135 result = usb_stor_bulk_transfer_sg(us, ipipe, srb->request_buffer, 135 result = usb_stor_bulk_srb(us, ipipe, srb);
136 count, srb->use_sg, &srb->resid);
137 US_DEBUGP("freecom_readdata done!\n"); 136 US_DEBUGP("freecom_readdata done!\n");
138 137
139 if (result > USB_STOR_XFER_SHORT) 138 if (result > USB_STOR_XFER_SHORT)
@@ -166,8 +165,7 @@ freecom_writedata (struct scsi_cmnd *srb, struct us_data *us,
166 165
167 /* Now transfer all of our blocks. */ 166 /* Now transfer all of our blocks. */
168 US_DEBUGP("Start of write\n"); 167 US_DEBUGP("Start of write\n");
169 result = usb_stor_bulk_transfer_sg(us, opipe, srb->request_buffer, 168 result = usb_stor_bulk_srb(us, opipe, srb);
170 count, srb->use_sg, &srb->resid);
171 169
172 US_DEBUGP("freecom_writedata done!\n"); 170 US_DEBUGP("freecom_writedata done!\n");
173 if (result > USB_STOR_XFER_SHORT) 171 if (result > USB_STOR_XFER_SHORT)
@@ -281,7 +279,7 @@ int freecom_transport(struct scsi_cmnd *srb, struct us_data *us)
281 * and such will hang. */ 279 * and such will hang. */
282 US_DEBUGP("Device indicates that it has %d bytes available\n", 280 US_DEBUGP("Device indicates that it has %d bytes available\n",
283 le16_to_cpu (fst->Count)); 281 le16_to_cpu (fst->Count));
284 US_DEBUGP("SCSI requested %d\n", srb->request_bufflen); 282 US_DEBUGP("SCSI requested %d\n", scsi_bufflen(srb));
285 283
286 /* Find the length we desire to read. */ 284 /* Find the length we desire to read. */
287 switch (srb->cmnd[0]) { 285 switch (srb->cmnd[0]) {
@@ -292,12 +290,12 @@ int freecom_transport(struct scsi_cmnd *srb, struct us_data *us)
292 length = le16_to_cpu(fst->Count); 290 length = le16_to_cpu(fst->Count);
293 break; 291 break;
294 default: 292 default:
295 length = srb->request_bufflen; 293 length = scsi_bufflen(srb);
296 } 294 }
297 295
298 /* verify that this amount is legal */ 296 /* verify that this amount is legal */
299 if (length > srb->request_bufflen) { 297 if (length > scsi_bufflen(srb)) {
300 length = srb->request_bufflen; 298 length = scsi_bufflen(srb);
301 US_DEBUGP("Truncating request to match buffer length: %d\n", length); 299 US_DEBUGP("Truncating request to match buffer length: %d\n", length);
302 } 300 }
303 301
diff --git a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c
index b12202c5da2d..8972b17da843 100644
--- a/drivers/usb/storage/sddr09.c
+++ b/drivers/usb/storage/sddr09.c
@@ -1623,7 +1623,7 @@ int sddr09_transport(struct scsi_cmnd *srb, struct us_data *us)
1623 return USB_STOR_TRANSPORT_ERROR; 1623 return USB_STOR_TRANSPORT_ERROR;
1624 } 1624 }
1625 1625
1626 if (srb->request_bufflen == 0) 1626 if (scsi_bufflen(srb) == 0)
1627 return USB_STOR_TRANSPORT_GOOD; 1627 return USB_STOR_TRANSPORT_GOOD;
1628 1628
1629 if (srb->sc_data_direction == DMA_TO_DEVICE || 1629 if (srb->sc_data_direction == DMA_TO_DEVICE ||
@@ -1634,12 +1634,9 @@ int sddr09_transport(struct scsi_cmnd *srb, struct us_data *us)
1634 US_DEBUGP("SDDR09: %s %d bytes\n", 1634 US_DEBUGP("SDDR09: %s %d bytes\n",
1635 (srb->sc_data_direction == DMA_TO_DEVICE) ? 1635 (srb->sc_data_direction == DMA_TO_DEVICE) ?
1636 "sending" : "receiving", 1636 "sending" : "receiving",
1637 srb->request_bufflen); 1637 scsi_bufflen(srb));
1638 1638
1639 result = usb_stor_bulk_transfer_sg(us, pipe, 1639 result = usb_stor_bulk_srb(us, pipe, srb);
1640 srb->request_buffer,
1641 srb->request_bufflen,
1642 srb->use_sg, &srb->resid);
1643 1640
1644 return (result == USB_STOR_XFER_GOOD ? 1641 return (result == USB_STOR_XFER_GOOD ?
1645 USB_STOR_TRANSPORT_GOOD : USB_STOR_TRANSPORT_ERROR); 1642 USB_STOR_TRANSPORT_GOOD : USB_STOR_TRANSPORT_ERROR);