diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2007-05-11 06:33:09 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-10-16 05:20:59 -0400 |
commit | 1f6f31a03e3aed0854a6aa3ab763c3d3b2ff42ff (patch) | |
tree | bdb94c08e0bce7c17f686aabc274a7554718407b /drivers/usb/storage/datafab.c | |
parent | 53d412fce05e73dd0b25b0ebfa83c7ee94f16451 (diff) |
USB storage: sg chaining support
[PATCH] USB storage: sg chaining support
Modify usb_stor_access_xfer_buf() to take a pointer to an sg
entry pointer, so we can keep track of that instead of passing
around an integer index (which we can't use when dealing with
multiple scatterlist arrays).
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/usb/storage/datafab.c')
-rw-r--r-- | drivers/usb/storage/datafab.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/storage/datafab.c b/drivers/usb/storage/datafab.c index c87ad1bae1d6..579e9f52053a 100644 --- a/drivers/usb/storage/datafab.c +++ b/drivers/usb/storage/datafab.c | |||
@@ -98,7 +98,8 @@ static int datafab_read_data(struct us_data *us, | |||
98 | unsigned char thistime; | 98 | unsigned char thistime; |
99 | unsigned int totallen, alloclen; | 99 | unsigned int totallen, alloclen; |
100 | int len, result; | 100 | int len, result; |
101 | unsigned int sg_idx = 0, sg_offset = 0; | 101 | unsigned int sg_offset = 0; |
102 | struct scatterlist *sg = NULL; | ||
102 | 103 | ||
103 | // we're working in LBA mode. according to the ATA spec, | 104 | // we're working in LBA mode. according to the ATA spec, |
104 | // we can support up to 28-bit addressing. I don't know if Datafab | 105 | // we can support up to 28-bit addressing. I don't know if Datafab |
@@ -155,7 +156,7 @@ static int datafab_read_data(struct us_data *us, | |||
155 | 156 | ||
156 | // Store the data in the transfer buffer | 157 | // Store the data in the transfer buffer |
157 | usb_stor_access_xfer_buf(buffer, len, us->srb, | 158 | usb_stor_access_xfer_buf(buffer, len, us->srb, |
158 | &sg_idx, &sg_offset, TO_XFER_BUF); | 159 | &sg, &sg_offset, TO_XFER_BUF); |
159 | 160 | ||
160 | sector += thistime; | 161 | sector += thistime; |
161 | totallen -= len; | 162 | totallen -= len; |
@@ -181,7 +182,8 @@ static int datafab_write_data(struct us_data *us, | |||
181 | unsigned char thistime; | 182 | unsigned char thistime; |
182 | unsigned int totallen, alloclen; | 183 | unsigned int totallen, alloclen; |
183 | int len, result; | 184 | int len, result; |
184 | unsigned int sg_idx = 0, sg_offset = 0; | 185 | unsigned int sg_offset = 0; |
186 | struct scatterlist *sg = NULL; | ||
185 | 187 | ||
186 | // we're working in LBA mode. according to the ATA spec, | 188 | // we're working in LBA mode. according to the ATA spec, |
187 | // we can support up to 28-bit addressing. I don't know if Datafab | 189 | // we can support up to 28-bit addressing. I don't know if Datafab |
@@ -217,7 +219,7 @@ static int datafab_write_data(struct us_data *us, | |||
217 | 219 | ||
218 | // Get the data from the transfer buffer | 220 | // Get the data from the transfer buffer |
219 | usb_stor_access_xfer_buf(buffer, len, us->srb, | 221 | usb_stor_access_xfer_buf(buffer, len, us->srb, |
220 | &sg_idx, &sg_offset, FROM_XFER_BUF); | 222 | &sg, &sg_offset, FROM_XFER_BUF); |
221 | 223 | ||
222 | command[0] = 0; | 224 | command[0] = 0; |
223 | command[1] = thistime; | 225 | command[1] = thistime; |