aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-floppy.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:35 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:35 -0400
commit394a4c2101f43bfb5fea7b5d1f5789a14ac018d7 (patch)
tree3ad1006008b2d1ff2eb4ce8b1433d921fa6b6a2c /drivers/ide/ide-floppy.c
parent20df429dd6671804999493baf2952f82582869fa (diff)
ide-{floppy,tape}: remove request stack
* Add 'struct request request_sense_rq' to struct ide_{floppy,tape}_obj and switch ide*_retry_pc() to use it (there can be only one REQUEST SENSE request active for a given device). * Remove no longer needed ide*_next_rq_storage(), rq_stack[] and rq_stack_index. * DBG_PCRQ_STACK -> DBG_PC_STACK * Update comments for IDE*_PC_STACK and idetape_queue_pc_{head,tail}(). There should be no functional changes caused by this patch. Cc: 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.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}