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.c29
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
1258 set_bit(PC_DMA_RECOMMENDED, &pc->flags); 1258 set_bit(PC_DMA_RECOMMENDED, &pc->flags);
1259} 1259}
1260 1260
1261static int 1261static void
1262idefloppy_blockpc_cmd(idefloppy_floppy_t *floppy, idefloppy_pc_t *pc, struct request *rq) 1262idefloppy_blockpc_cmd(idefloppy_floppy_t *floppy, idefloppy_pc_t *pc, struct request *rq)
1263{ 1263{
1264 /*
1265 * just support eject for now, it would not be hard to make the
1266 * REQ_BLOCK_PC support fully-featured
1267 */
1268 if (rq->cmd[0] != IDEFLOPPY_START_STOP_CMD)
1269 return 1;
1270
1271 idefloppy_init_pc(pc); 1264 idefloppy_init_pc(pc);
1265 pc->callback = &idefloppy_rw_callback;
1272 memcpy(pc->c, rq->cmd, sizeof(pc->c)); 1266 memcpy(pc->c, rq->cmd, sizeof(pc->c));
1273 return 0; 1267 pc->rq = rq;
1268 pc->b_count = rq->data_len;
1269 if (rq->data_len && rq_data_dir(rq) == WRITE)
1270 set_bit(PC_WRITING, &pc->flags);
1271 pc->buffer = rq->data;
1272 if (rq->bio)
1273 set_bit(PC_DMA_RECOMMENDED, &pc->flags);
1274
1275 /*
1276 * possibly problematic, doesn't look like ide-floppy correctly
1277 * handled scattered requests if dma fails...
1278 */
1279 pc->request_transfer = pc->buffer_size = rq->data_len;
1274} 1280}
1275 1281
1276/* 1282/*
@@ -1317,10 +1323,7 @@ static ide_startstop_t idefloppy_do_request (ide_drive_t *drive, struct request
1317 pc = (idefloppy_pc_t *) rq->buffer; 1323 pc = (idefloppy_pc_t *) rq->buffer;
1318 } else if (blk_pc_request(rq)) { 1324 } else if (blk_pc_request(rq)) {
1319 pc = idefloppy_next_pc_storage(drive); 1325 pc = idefloppy_next_pc_storage(drive);
1320 if (idefloppy_blockpc_cmd(floppy, pc, rq)) { 1326 idefloppy_blockpc_cmd(floppy, pc, rq);
1321 idefloppy_do_end_request(drive, 0, 0);
1322 return ide_stopped;
1323 }
1324 } else { 1327 } else {
1325 blk_dump_rq_flags(rq, 1328 blk_dump_rq_flags(rq,
1326 "ide-floppy: unsupported command in queue"); 1329 "ide-floppy: unsupported command in queue");