|
73 | 73 | #define CAPACITY_CURRENT 0x02 |
74 | 74 | #define CAPACITY_NO_CARTRIDGE 0x03 |
75 | 75 |
|
76 | | -#define IDEFLOPPY_TICKS_DELAY HZ/20 /* default delay for ZIP 100 (50ms) */ |
| 76 | +/* |
| 77 | + * The following delay solves a problem with ATAPI Zip 100 drive where BSY bit |
| 78 | + * was apparently being deasserted before the unit was ready to receive data. |
| 79 | + */ |
| 80 | +#define IDEFLOPPY_PC_DELAY (HZ/20) /* default delay for ZIP 100 (50ms) */ |
77 | 81 |
|
78 | 82 | /* Error code returned in rq->errors to the higher part of the driver. */ |
79 | 83 | #define IDEFLOPPY_ERROR_GENERAL 101 |
@@ -193,51 +197,6 @@ static void ide_floppy_callback(ide_drive_t *drive, int dsc) |
193 | 197 | idefloppy_end_request(drive, uptodate, 0); |
194 | 198 | } |
195 | 199 |
|
196 | | -/* |
197 | | - * What we have here is a classic case of a top half / bottom half interrupt |
198 | | - * service routine. In interrupt mode, the device sends an interrupt to signal |
199 | | - * that it is ready to receive a packet. However, we need to delay about 2-3 |
200 | | - * ticks before issuing the packet or we gets in trouble. |
201 | | - */ |
202 | | -static int idefloppy_transfer_pc(ide_drive_t *drive) |
203 | | -{ |
204 | | - /* Send the actual packet */ |
205 | | - drive->hwif->tp_ops->output_data(drive, NULL, drive->pc->c, 12); |
206 | | - |
207 | | - /* Timeout for the packet command */ |
208 | | - return WAIT_FLOPPY_CMD; |
209 | | -} |
210 | | - |
211 | | -/* |
212 | | - * Called as an interrupt (or directly). When the device says it's ready for a |
213 | | - * packet, we schedule the packet transfer to occur about 2-3 ticks later in |
214 | | - * transfer_pc. |
215 | | - */ |
216 | | -static ide_startstop_t idefloppy_start_pc_transfer(ide_drive_t *drive) |
217 | | -{ |
218 | | - idefloppy_floppy_t *floppy = drive->driver_data; |
219 | | - ide_expiry_t *expiry; |
220 | | - unsigned int timeout; |
221 | | - |
222 | | - /* |
223 | | - * The following delay solves a problem with ATAPI Zip 100 drives |
224 | | - * where the Busy flag was apparently being deasserted before the |
225 | | - * unit was ready to receive data. This was happening on a |
226 | | - * 1200 MHz Athlon system. 10/26/01 25msec is too short, |
227 | | - * 40 and 50msec work well. ide_pc_intr will not be actually |
228 | | - * used until after the packet is moved in about 50 msec. |
229 | | - */ |
230 | | - if (drive->atapi_flags & IDE_AFLAG_ZIP_DRIVE) { |
231 | | - timeout = floppy->ticks; |
232 | | - expiry = &idefloppy_transfer_pc; |
233 | | - } else { |
234 | | - timeout = WAIT_FLOPPY_CMD; |
235 | | - expiry = NULL; |
236 | | - } |
237 | | - |
238 | | - return ide_transfer_pc(drive, timeout, expiry); |
239 | | -} |
240 | | - |
241 | 200 | static void ide_floppy_report_error(idefloppy_floppy_t *floppy, |
242 | 201 | struct ide_atapi_pc *pc) |
243 | 202 | { |
@@ -281,8 +240,7 @@ static ide_startstop_t idefloppy_issue_pc(ide_drive_t *drive, |
281 | 240 |
|
282 | 241 | pc->retries++; |
283 | 242 |
|
284 | | - return ide_issue_pc(drive, idefloppy_start_pc_transfer, |
285 | | - WAIT_FLOPPY_CMD, NULL); |
| 243 | + return ide_issue_pc(drive, WAIT_FLOPPY_CMD, NULL); |
286 | 244 | } |
287 | 245 |
|
288 | 246 | void ide_floppy_create_read_capacity_cmd(struct ide_atapi_pc *pc) |
@@ -597,21 +555,7 @@ static sector_t idefloppy_capacity(ide_drive_t *drive) |
597 | 555 | ide_devset_rw_field(bios_cyl, bios_cyl); |
598 | 556 | ide_devset_rw_field(bios_head, bios_head); |
599 | 557 | ide_devset_rw_field(bios_sect, bios_sect); |
600 | | - |
601 | | -static int get_ticks(ide_drive_t *drive) |
602 | | -{ |
603 | | - idefloppy_floppy_t *floppy = drive->driver_data; |
604 | | - return floppy->ticks; |
605 | | -} |
606 | | - |
607 | | -static int set_ticks(ide_drive_t *drive, int arg) |
608 | | -{ |
609 | | - idefloppy_floppy_t *floppy = drive->driver_data; |
610 | | - floppy->ticks = arg; |
611 | | - return 0; |
612 | | -} |
613 | | - |
614 | | -IDE_DEVSET(ticks, DS_SYNC, get_ticks, set_ticks); |
| 558 | +ide_devset_rw_field(ticks, pc_delay); |
615 | 559 |
|
616 | 560 | static const struct ide_proc_devset idefloppy_settings[] = { |
617 | 561 | IDE_PROC_DEVSET(bios_cyl, 0, 1023), |
@@ -647,7 +591,7 @@ static void idefloppy_setup(ide_drive_t *drive, idefloppy_floppy_t *floppy) |
647 | 591 | if (!strncmp((char *)&id[ATA_ID_PROD], "IOMEGA ZIP 100 ATAPI", 20)) { |
648 | 592 | drive->atapi_flags |= IDE_AFLAG_ZIP_DRIVE; |
649 | 593 | /* This value will be visible in the /proc/ide/hdx/settings */ |
650 | | - floppy->ticks = IDEFLOPPY_TICKS_DELAY; |
| 594 | + drive->pc_delay = IDEFLOPPY_PC_DELAY; |
651 | 595 | blk_queue_max_sectors(drive->queue, 64); |
652 | 596 | } |
653 | 597 |
|
|
0 commit comments