diff options
Diffstat (limited to 'drivers/ide/ide-floppy.c')
-rw-r--r-- | drivers/ide/ide-floppy.c | 122 |
1 files changed, 6 insertions, 116 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index ff8232ef965..3512637ae8d 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -1,13 +1,12 @@ | |||
1 | /* | 1 | /* |
2 | * linux/drivers/ide/ide-floppy.c Version 0.99 Feb 24 2002 | 2 | * IDE ATAPI floppy driver. |
3 | * | 3 | * |
4 | * Copyright (C) 1996 - 1999 Gadi Oxman <gadio@netvision.net.il> | 4 | * Copyright (C) 1996-1999 Gadi Oxman <gadio@netvision.net.il> |
5 | * Copyright (C) 2000 - 2002 Paul Bristow <paul@paulbristow.net> | 5 | * Copyright (C) 2000-2002 Paul Bristow <paul@paulbristow.net> |
6 | * Copyright (C) 2005 Bartlomiej Zolnierkiewicz | ||
6 | */ | 7 | */ |
7 | 8 | ||
8 | /* | 9 | /* |
9 | * IDE ATAPI floppy driver. | ||
10 | * | ||
11 | * The driver currently doesn't have any fancy features, just the bare | 10 | * The driver currently doesn't have any fancy features, just the bare |
12 | * minimum read/write support. | 11 | * minimum read/write support. |
13 | * | 12 | * |
@@ -17,67 +16,8 @@ | |||
17 | * Iomega Zip 100/250 | 16 | * Iomega Zip 100/250 |
18 | * Iomega PC Card Clik!/PocketZip | 17 | * Iomega PC Card Clik!/PocketZip |
19 | * | 18 | * |
20 | * Many thanks to Lode Leroy <Lode.Leroy@www.ibase.be>, who tested so many | 19 | * For a historical changelog see |
21 | * ALPHA patches to this driver on an EASYSTOR LS-120 ATAPI floppy drive. | 20 | * Documentation/ide/ChangeLog.ide-floppy.1996-2002 |
22 | * | ||
23 | * Ver 0.1 Oct 17 96 Initial test version, mostly based on ide-tape.c. | ||
24 | * Ver 0.2 Oct 31 96 Minor changes. | ||
25 | * Ver 0.3 Dec 2 96 Fixed error recovery bug. | ||
26 | * Ver 0.4 Jan 26 97 Add support for the HDIO_GETGEO ioctl. | ||
27 | * Ver 0.5 Feb 21 97 Add partitions support. | ||
28 | * Use the minimum of the LBA and CHS capacities. | ||
29 | * Avoid hwgroup->rq == NULL on the last irq. | ||
30 | * Fix potential null dereferencing with DEBUG_LOG. | ||
31 | * Ver 0.8 Dec 7 97 Increase irq timeout from 10 to 50 seconds. | ||
32 | * Add media write-protect detection. | ||
33 | * Issue START command only if TEST UNIT READY fails. | ||
34 | * Add work-around for IOMEGA ZIP revision 21.D. | ||
35 | * Remove idefloppy_get_capabilities(). | ||
36 | * Ver 0.9 Jul 4 99 Fix a bug which might have caused the number of | ||
37 | * bytes requested on each interrupt to be zero. | ||
38 | * Thanks to <shanos@es.co.nz> for pointing this out. | ||
39 | * Ver 0.9.sv Jan 6 01 Sam Varshavchik <mrsam@courier-mta.com> | ||
40 | * Implement low level formatting. Reimplemented | ||
41 | * IDEFLOPPY_CAPABILITIES_PAGE, since we need the srfp | ||
42 | * bit. My LS-120 drive barfs on | ||
43 | * IDEFLOPPY_CAPABILITIES_PAGE, but maybe it's just me. | ||
44 | * Compromise by not reporting a failure to get this | ||
45 | * mode page. Implemented four IOCTLs in order to | ||
46 | * implement formatting. IOCTls begin with 0x4600, | ||
47 | * 0x46 is 'F' as in Format. | ||
48 | * Jan 9 01 Userland option to select format verify. | ||
49 | * Added PC_SUPPRESS_ERROR flag - some idefloppy drives | ||
50 | * do not implement IDEFLOPPY_CAPABILITIES_PAGE, and | ||
51 | * return a sense error. Suppress error reporting in | ||
52 | * this particular case in order to avoid spurious | ||
53 | * errors in syslog. The culprit is | ||
54 | * idefloppy_get_capability_page(), so move it to | ||
55 | * idefloppy_begin_format() so that it's not used | ||
56 | * unless absolutely necessary. | ||
57 | * If drive does not support format progress indication | ||
58 | * monitor the dsc bit in the status register. | ||
59 | * Also, O_NDELAY on open will allow the device to be | ||
60 | * opened without a disk available. This can be used to | ||
61 | * open an unformatted disk, or get the device capacity. | ||
62 | * Ver 0.91 Dec 11 99 Added IOMEGA Clik! drive support by | ||
63 | * <paul@paulbristow.net> | ||
64 | * Ver 0.92 Oct 22 00 Paul Bristow became official maintainer for this | ||
65 | * driver. Included Powerbook internal zip kludge. | ||
66 | * Ver 0.93 Oct 24 00 Fixed bugs for Clik! drive | ||
67 | * no disk on insert and disk change now works | ||
68 | * Ver 0.94 Oct 27 00 Tidied up to remove strstr(Clik) everywhere | ||
69 | * Ver 0.95 Nov 7 00 Brought across to kernel 2.4 | ||
70 | * Ver 0.96 Jan 7 01 Actually in line with release version of 2.4.0 | ||
71 | * including set_bit patch from Rusty Russell | ||
72 | * Ver 0.97 Jul 22 01 Merge 0.91-0.96 onto 0.9.sv for ac series | ||
73 | * Ver 0.97.sv Aug 3 01 Backported from 2.4.7-ac3 | ||
74 | * Ver 0.98 Oct 26 01 Split idefloppy_transfer_pc into two pieces to | ||
75 | * fix a lost interrupt problem. It appears the busy | ||
76 | * bit was being deasserted by my IOMEGA ATAPI ZIP 100 | ||
77 | * drive before the drive was actually ready. | ||
78 | * Ver 0.98a Oct 29 01 Expose delay value so we can play. | ||
79 | * Ver 0.99 Feb 24 02 Remove duplicate code, modify clik! detection code | ||
80 | * to support new PocketZip drives | ||
81 | */ | 21 | */ |
82 | 22 | ||
83 | #define IDEFLOPPY_VERSION "0.99.newide" | 23 | #define IDEFLOPPY_VERSION "0.99.newide" |
@@ -1658,7 +1598,6 @@ static int idefloppy_identify_device (ide_drive_t *drive,struct hd_driveid *id) | |||
1658 | { | 1598 | { |
1659 | struct idefloppy_id_gcw gcw; | 1599 | struct idefloppy_id_gcw gcw; |
1660 | #if IDEFLOPPY_DEBUG_INFO | 1600 | #if IDEFLOPPY_DEBUG_INFO |
1661 | u16 mask,i; | ||
1662 | char buffer[80]; | 1601 | char buffer[80]; |
1663 | #endif /* IDEFLOPPY_DEBUG_INFO */ | 1602 | #endif /* IDEFLOPPY_DEBUG_INFO */ |
1664 | 1603 | ||
@@ -1705,55 +1644,6 @@ static int idefloppy_identify_device (ide_drive_t *drive,struct hd_driveid *id) | |||
1705 | default: sprintf(buffer, "Reserved");break; | 1644 | default: sprintf(buffer, "Reserved");break; |
1706 | } | 1645 | } |
1707 | printk(KERN_INFO "Command Packet Size: %s\n", buffer); | 1646 | printk(KERN_INFO "Command Packet Size: %s\n", buffer); |
1708 | printk(KERN_INFO "Model: %.40s\n",id->model); | ||
1709 | printk(KERN_INFO "Firmware Revision: %.8s\n",id->fw_rev); | ||
1710 | printk(KERN_INFO "Serial Number: %.20s\n",id->serial_no); | ||
1711 | printk(KERN_INFO "Write buffer size(?): %d bytes\n",id->buf_size*512); | ||
1712 | printk(KERN_INFO "DMA: %s",id->capability & 0x01 ? "Yes\n":"No\n"); | ||
1713 | printk(KERN_INFO "LBA: %s",id->capability & 0x02 ? "Yes\n":"No\n"); | ||
1714 | printk(KERN_INFO "IORDY can be disabled: %s",id->capability & 0x04 ? "Yes\n":"No\n"); | ||
1715 | printk(KERN_INFO "IORDY supported: %s",id->capability & 0x08 ? "Yes\n":"Unknown\n"); | ||
1716 | printk(KERN_INFO "ATAPI overlap supported: %s",id->capability & 0x20 ? "Yes\n":"No\n"); | ||
1717 | printk(KERN_INFO "PIO Cycle Timing Category: %d\n",id->tPIO); | ||
1718 | printk(KERN_INFO "DMA Cycle Timing Category: %d\n",id->tDMA); | ||
1719 | printk(KERN_INFO "Single Word DMA supported modes:\n"); | ||
1720 | for (i=0,mask=1;i<8;i++,mask=mask << 1) { | ||
1721 | if (id->dma_1word & mask) | ||
1722 | printk(KERN_INFO " Mode %d%s\n", i, | ||
1723 | (id->dma_1word & (mask << 8)) ? " (active)" : ""); | ||
1724 | } | ||
1725 | printk(KERN_INFO "Multi Word DMA supported modes:\n"); | ||
1726 | for (i=0,mask=1;i<8;i++,mask=mask << 1) { | ||
1727 | if (id->dma_mword & mask) | ||
1728 | printk(KERN_INFO " Mode %d%s\n", i, | ||
1729 | (id->dma_mword & (mask << 8)) ? " (active)" : ""); | ||
1730 | } | ||
1731 | if (id->field_valid & 0x0002) { | ||
1732 | printk(KERN_INFO "Enhanced PIO Modes: %s\n", | ||
1733 | id->eide_pio_modes & 1 ? "Mode 3":"None"); | ||
1734 | if (id->eide_dma_min == 0) | ||
1735 | sprintf(buffer, "Not supported"); | ||
1736 | else | ||
1737 | sprintf(buffer, "%d ns",id->eide_dma_min); | ||
1738 | printk(KERN_INFO "Minimum Multi-word DMA cycle per word: %s\n", buffer); | ||
1739 | if (id->eide_dma_time == 0) | ||
1740 | sprintf(buffer, "Not supported"); | ||
1741 | else | ||
1742 | sprintf(buffer, "%d ns",id->eide_dma_time); | ||
1743 | printk(KERN_INFO "Manufacturer\'s Recommended Multi-word cycle: %s\n", buffer); | ||
1744 | if (id->eide_pio == 0) | ||
1745 | sprintf(buffer, "Not supported"); | ||
1746 | else | ||
1747 | sprintf(buffer, "%d ns",id->eide_pio); | ||
1748 | printk(KERN_INFO "Minimum PIO cycle without IORDY: %s\n", | ||
1749 | buffer); | ||
1750 | if (id->eide_pio_iordy == 0) | ||
1751 | sprintf(buffer, "Not supported"); | ||
1752 | else | ||
1753 | sprintf(buffer, "%d ns",id->eide_pio_iordy); | ||
1754 | printk(KERN_INFO "Minimum PIO cycle with IORDY: %s\n", buffer); | ||
1755 | } else | ||
1756 | printk(KERN_INFO "According to the device, fields 64-70 are not valid.\n"); | ||
1757 | #endif /* IDEFLOPPY_DEBUG_INFO */ | 1647 | #endif /* IDEFLOPPY_DEBUG_INFO */ |
1758 | 1648 | ||
1759 | if (gcw.protocol != 2) | 1649 | if (gcw.protocol != 2) |