aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-floppy.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-floppy.c')
-rw-r--r--drivers/ide/ide-floppy.c47
1 files changed, 1 insertions, 46 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index a0a8ad3a3038..38dca45ffd11 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -208,51 +208,6 @@ static int idefloppy_end_request(ide_drive_t *drive, int uptodate, int nsecs)
208 return 0; 208 return 0;
209} 209}
210 210
211static void ide_floppy_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc,
212 unsigned int bcount, int direction)
213{
214 ide_hwif_t *hwif = drive->hwif;
215 const struct ide_tp_ops *tp_ops = hwif->tp_ops;
216 xfer_func_t *xf = direction ? tp_ops->output_data : tp_ops->input_data;
217 struct scatterlist *sg = pc->sg;
218 char *buf;
219 int count, done = 0;
220
221 while (bcount) {
222 count = min(sg->length - pc->b_count, bcount);
223 if (PageHighMem(sg_page(sg))) {
224 unsigned long flags;
225
226 local_irq_save(flags);
227 buf = kmap_atomic(sg_page(sg), KM_IRQ0) + sg->offset;
228 xf(drive, NULL, buf + pc->b_count, count);
229 kunmap_atomic(buf - sg->offset, KM_IRQ0);
230 local_irq_restore(flags);
231 } else {
232 buf = sg_virt(sg);
233 xf(drive, NULL, buf + pc->b_count, count);
234 }
235 bcount -= count;
236 pc->b_count += count;
237 done += count;
238
239 if (pc->b_count == sg->length) {
240 if (!--pc->sg_cnt)
241 break;
242 pc->sg = sg = sg_next(sg);
243 pc->b_count = 0;
244 }
245 }
246
247 idefloppy_end_request(drive, 1, done >> 9);
248
249 if (bcount) {
250 printk(KERN_ERR "%s: leftover data in %s, bcount == %d\n",
251 drive->name, __func__, bcount);
252 ide_pad_transfer(drive, direction, bcount);
253 }
254}
255
256static void idefloppy_update_buffers(ide_drive_t *drive, 211static void idefloppy_update_buffers(ide_drive_t *drive,
257 struct ide_atapi_pc *pc) 212 struct ide_atapi_pc *pc)
258{ 213{
@@ -356,7 +311,7 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive)
356 311
357 return ide_pc_intr(drive, floppy->pc, idefloppy_pc_intr, 312 return ide_pc_intr(drive, floppy->pc, idefloppy_pc_intr,
358 IDEFLOPPY_WAIT_CMD, NULL, idefloppy_update_buffers, 313 IDEFLOPPY_WAIT_CMD, NULL, idefloppy_update_buffers,
359 idefloppy_retry_pc, NULL, ide_floppy_io_buffers); 314 idefloppy_retry_pc, NULL, ide_io_buffers);
360} 315}
361 316
362/* 317/*