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.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 06db5edf9cee..41bb61037da2 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -77,8 +77,8 @@
77 77
78/* 78/*
79 * In various places in the driver, we need to allocate storage for packet 79 * In various places in the driver, we need to allocate storage for packet
80 * commands and requests, which will remain valid while we leave the driver to 80 * commands, which will remain valid while we leave the driver to wait for
81 * wait for an interrupt or a timeout event. 81 * an interrupt or a timeout event.
82 */ 82 */
83#define IDEFLOPPY_PC_STACK (10 + IDEFLOPPY_MAX_PC_RETRIES) 83#define IDEFLOPPY_PC_STACK (10 + IDEFLOPPY_MAX_PC_RETRIES)
84 84
@@ -108,9 +108,8 @@ typedef struct ide_floppy_obj {
108 struct ide_atapi_pc pc_stack[IDEFLOPPY_PC_STACK]; 108 struct ide_atapi_pc pc_stack[IDEFLOPPY_PC_STACK];
109 /* Next free packet command storage space */ 109 /* Next free packet command storage space */
110 int pc_stack_index; 110 int pc_stack_index;
111 struct request rq_stack[IDEFLOPPY_PC_STACK]; 111
112 /* We implement a circular array */ 112 struct request request_sense_rq;
113 int rq_stack_index;
114 113
115 /* Last error information */ 114 /* Last error information */
116 u8 sense_key, asc, ascq; 115 u8 sense_key, asc, ascq;
@@ -306,15 +305,6 @@ static struct ide_atapi_pc *idefloppy_next_pc_storage(ide_drive_t *drive)
306 return (&floppy->pc_stack[floppy->pc_stack_index++]); 305 return (&floppy->pc_stack[floppy->pc_stack_index++]);
307} 306}
308 307
309static struct request *idefloppy_next_rq_storage(ide_drive_t *drive)
310{
311 idefloppy_floppy_t *floppy = drive->driver_data;
312
313 if (floppy->rq_stack_index == IDEFLOPPY_PC_STACK)
314 floppy->rq_stack_index = 0;
315 return (&floppy->rq_stack[floppy->rq_stack_index++]);
316}
317
318static void ide_floppy_callback(ide_drive_t *drive) 308static void ide_floppy_callback(ide_drive_t *drive)
319{ 309{
320 idefloppy_floppy_t *floppy = drive->driver_data; 310 idefloppy_floppy_t *floppy = drive->driver_data;
@@ -373,12 +363,12 @@ static void idefloppy_create_request_sense_cmd(struct ide_atapi_pc *pc)
373 */ 363 */
374static void idefloppy_retry_pc(ide_drive_t *drive) 364static void idefloppy_retry_pc(ide_drive_t *drive)
375{ 365{
366 struct ide_floppy_obj *floppy = drive->driver_data;
367 struct request *rq = &floppy->request_sense_rq;
376 struct ide_atapi_pc *pc; 368 struct ide_atapi_pc *pc;
377 struct request *rq;
378 369
379 (void)ide_read_error(drive); 370 (void)ide_read_error(drive);
380 pc = idefloppy_next_pc_storage(drive); 371 pc = idefloppy_next_pc_storage(drive);
381 rq = idefloppy_next_rq_storage(drive);
382 idefloppy_create_request_sense_cmd(pc); 372 idefloppy_create_request_sense_cmd(pc);
383 idefloppy_queue_pc_head(drive, pc, rq); 373 idefloppy_queue_pc_head(drive, pc, rq);
384} 374}