diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:26 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:26 -0400 |
commit | 349d12a1fe57d49287a539909cf14f362634342d (patch) | |
tree | 632b6f33a0424db5507ac099aa7292daa7902f26 /drivers/ide/ide-floppy.c | |
parent | d93bc4521c80e9d87767779814e88f6d725453d7 (diff) |
ide-floppy: use ide_pio_bytes()
* Fix ide_init_sg_cmd() setup for non-fs requests.
* Convert ide_pc_intr() to use ide_pio_bytes() for floppy media.
* Remove no longer needed ide_io_buffers() and sg/sg_cnt fields
from struct ide_atapi_pc.
* Remove partial completions; kill idefloppy_update_buffers(), as a
result.
* Add some more debugging statements.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-floppy.c')
-rw-r--r-- | drivers/ide/ide-floppy.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 0faae3098295..2b4868d95f8b 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -61,16 +61,6 @@ | |||
61 | */ | 61 | */ |
62 | #define IDEFLOPPY_PC_DELAY (HZ/20) /* default delay for ZIP 100 (50ms) */ | 62 | #define IDEFLOPPY_PC_DELAY (HZ/20) /* default delay for ZIP 100 (50ms) */ |
63 | 63 | ||
64 | static void idefloppy_update_buffers(ide_drive_t *drive, | ||
65 | struct ide_atapi_pc *pc) | ||
66 | { | ||
67 | struct request *rq = pc->rq; | ||
68 | struct bio *bio = rq->bio; | ||
69 | |||
70 | while ((bio = rq->bio) != NULL) | ||
71 | ide_complete_rq(drive, 0, ide_rq_bytes(rq)); | ||
72 | } | ||
73 | |||
74 | static int ide_floppy_callback(ide_drive_t *drive, int dsc) | 64 | static int ide_floppy_callback(ide_drive_t *drive, int dsc) |
75 | { | 65 | { |
76 | struct ide_disk_obj *floppy = drive->driver_data; | 66 | struct ide_disk_obj *floppy = drive->driver_data; |
@@ -213,7 +203,6 @@ static void idefloppy_create_rw_cmd(ide_drive_t *drive, | |||
213 | memcpy(rq->cmd, pc->c, 12); | 203 | memcpy(rq->cmd, pc->c, 12); |
214 | 204 | ||
215 | pc->rq = rq; | 205 | pc->rq = rq; |
216 | pc->b_count = 0; | ||
217 | if (rq->cmd_flags & REQ_RW) | 206 | if (rq->cmd_flags & REQ_RW) |
218 | pc->flags |= PC_FLAG_WRITING; | 207 | pc->flags |= PC_FLAG_WRITING; |
219 | pc->buf = NULL; | 208 | pc->buf = NULL; |
@@ -227,7 +216,6 @@ static void idefloppy_blockpc_cmd(struct ide_disk_obj *floppy, | |||
227 | ide_init_pc(pc); | 216 | ide_init_pc(pc); |
228 | memcpy(pc->c, rq->cmd, sizeof(pc->c)); | 217 | memcpy(pc->c, rq->cmd, sizeof(pc->c)); |
229 | pc->rq = rq; | 218 | pc->rq = rq; |
230 | pc->b_count = 0; | ||
231 | if (rq->data_len && rq_data_dir(rq) == WRITE) | 219 | if (rq->data_len && rq_data_dir(rq) == WRITE) |
232 | pc->flags |= PC_FLAG_WRITING; | 220 | pc->flags |= PC_FLAG_WRITING; |
233 | pc->buf = rq->data; | 221 | pc->buf = rq->data; |
@@ -244,10 +232,11 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive, | |||
244 | struct request *rq, sector_t block) | 232 | struct request *rq, sector_t block) |
245 | { | 233 | { |
246 | struct ide_disk_obj *floppy = drive->driver_data; | 234 | struct ide_disk_obj *floppy = drive->driver_data; |
247 | ide_hwif_t *hwif = drive->hwif; | ||
248 | struct ide_cmd cmd; | 235 | struct ide_cmd cmd; |
249 | struct ide_atapi_pc *pc; | 236 | struct ide_atapi_pc *pc; |
250 | 237 | ||
238 | ide_debug_log(IDE_DBG_FUNC, "enter, cmd: 0x%x\n", rq->cmd[0]); | ||
239 | |||
251 | if (drive->debug_mask & IDE_DBG_RQ) | 240 | if (drive->debug_mask & IDE_DBG_RQ) |
252 | blk_dump_rq_flags(rq, (rq->rq_disk | 241 | blk_dump_rq_flags(rq, (rq->rq_disk |
253 | ? rq->rq_disk->disk_name | 242 | ? rq->rq_disk->disk_name |
@@ -294,13 +283,10 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive, | |||
294 | cmd.rq = rq; | 283 | cmd.rq = rq; |
295 | 284 | ||
296 | if (blk_fs_request(rq) || pc->req_xfer) { | 285 | if (blk_fs_request(rq) || pc->req_xfer) { |
297 | ide_init_sg_cmd(&cmd, rq->nr_sectors << 9); | 286 | ide_init_sg_cmd(&cmd, pc->req_xfer); |
298 | ide_map_sg(drive, &cmd); | 287 | ide_map_sg(drive, &cmd); |
299 | } | 288 | } |
300 | 289 | ||
301 | pc->sg = hwif->sg_table; | ||
302 | pc->sg_cnt = cmd.sg_nents; | ||
303 | |||
304 | pc->rq = rq; | 290 | pc->rq = rq; |
305 | 291 | ||
306 | return ide_floppy_issue_pc(drive, &cmd, pc); | 292 | return ide_floppy_issue_pc(drive, &cmd, pc); |
@@ -388,6 +374,8 @@ static int ide_floppy_get_capacity(ide_drive_t *drive) | |||
388 | u8 pc_buf[256], header_len, desc_cnt; | 374 | u8 pc_buf[256], header_len, desc_cnt; |
389 | int i, rc = 1, blocks, length; | 375 | int i, rc = 1, blocks, length; |
390 | 376 | ||
377 | ide_debug_log(IDE_DBG_FUNC, "enter"); | ||
378 | |||
391 | drive->bios_cyl = 0; | 379 | drive->bios_cyl = 0; |
392 | drive->bios_head = drive->bios_sect = 0; | 380 | drive->bios_head = drive->bios_sect = 0; |
393 | floppy->blocks = 0; | 381 | floppy->blocks = 0; |
@@ -488,8 +476,6 @@ static void ide_floppy_setup(ide_drive_t *drive) | |||
488 | u16 *id = drive->id; | 476 | u16 *id = drive->id; |
489 | 477 | ||
490 | drive->pc_callback = ide_floppy_callback; | 478 | drive->pc_callback = ide_floppy_callback; |
491 | drive->pc_update_buffers = idefloppy_update_buffers; | ||
492 | drive->pc_io_buffers = ide_io_buffers; | ||
493 | 479 | ||
494 | /* | 480 | /* |
495 | * We used to check revisions here. At this point however I'm giving up. | 481 | * We used to check revisions here. At this point however I'm giving up. |