diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2007-07-09 14:38:05 +0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-07-16 10:52:44 +0400 |
commit | 3d6392cfbd7dc11f23058e3493683afab4ac13a3 (patch) | |
tree | 70c2b65c479f5feb7a5214a4a4930d489a069b1f /drivers/ide/ide-floppy.c | |
parent | 8f41958bdd577731f7411c9605cfaa9db6766809 (diff) | |
download | linux-3d6392cfbd7dc11f23058e3493683afab4ac13a3.tar.xz |
bsg: support for full generic block layer SG v3
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/ide/ide-floppy.c')
-rw-r--r-- | drivers/ide/ide-floppy.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index f429be88c4f9..a21f585b1caa 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c @@ -1258,19 +1258,25 @@ static void idefloppy_create_rw_cmd (idefloppy_floppy_t *floppy, idefloppy_pc_t set_bit(PC_DMA_RECOMMENDED, &pc->flags); } -static int +static void idefloppy_blockpc_cmd(idefloppy_floppy_t *floppy, idefloppy_pc_t *pc, struct request *rq) { - /* - * just support eject for now, it would not be hard to make the - * REQ_BLOCK_PC support fully-featured - */ - if (rq->cmd[0] != IDEFLOPPY_START_STOP_CMD) - return 1; - idefloppy_init_pc(pc); + pc->callback = &idefloppy_rw_callback; memcpy(pc->c, rq->cmd, sizeof(pc->c)); - return 0; + pc->rq = rq; + pc->b_count = rq->data_len; + if (rq->data_len && rq_data_dir(rq) == WRITE) + set_bit(PC_WRITING, &pc->flags); + pc->buffer = rq->data; + if (rq->bio) + set_bit(PC_DMA_RECOMMENDED, &pc->flags); + + /* + * possibly problematic, doesn't look like ide-floppy correctly + * handled scattered requests if dma fails... + */ + pc->request_transfer = pc->buffer_size = rq->data_len; } /* @@ -1317,10 +1323,7 @@ static ide_startstop_t idefloppy_do_request (ide_drive_t *drive, struct request pc = (idefloppy_pc_t *) rq->buffer; } else if (blk_pc_request(rq)) { pc = idefloppy_next_pc_storage(drive); - if (idefloppy_blockpc_cmd(floppy, pc, rq)) { - idefloppy_do_end_request(drive, 0, 0); - return ide_stopped; - } + idefloppy_blockpc_cmd(floppy, pc, rq); } else { blk_dump_rq_flags(rq, "ide-floppy: unsupported command in queue"); |