[patches] Slow PS/2-floppies and ESDI

David Weinehall (tao@acc.umu.se)
Thu, 1 Oct 1998 00:49:15 +0200 (MET_DST)


These two *small* patches (compiling cleanly into v2.1.122, but should
work equally well on v2.1.123), touches only one file each, and does the
following:

The first patch modifies **floppy.c** by adding a flag "slow"
that slows the step-rate down to 1/4 of the normal; some models of the IBM
PS/2 has a buggy floppy that doesn't work without this patch.

The second patch modifies **main.c** by removing the NO-NO! "ed=" entry
and adding the needed "edb=" entry.

Any comments are welcome.

/David Weinehall

>--------------------------------------------------------------------<
> <
> *****.. Tao of TRIAD *****.. <
> ****......... ______________ ****......... <
> ****.....***... ****.....***... <
> ****......***.... David Weinehall ****......***.... <
> ******........... V Varmvattnet 63 ******........... <
> ***********...... S - 922 67 TAVELSJO ***********...... <
> ****...******.... SWEDEN ****...******.... <
> ***...*****.... ***...*****.... <
> *********.... Tel # : +46(0)90 - 604 10 *********.... <
> **..... E-mail: tao@acc.umu.se **..... <
> Home-page: http://www.acc.umu.se/~tao/ <
>--------------------------------------------------------------------<

--- linux-2.1.122/drivers/block/floppy.c Sun Sep 13 21:12:34 1998
+++ linux-2.1.122mca/drivers/block/floppy.c Thu Oct 1 00:14:43 1998
@@ -102,6 +102,10 @@
* failures.
*/

+/*
+ * 1998/09/20 -- David Weinehall -- Added slow-down code for buggy PS/2-drives.
+ */
+
#define FLOPPY_SANITY_CHECK
#undef FLOPPY_SILENT_DCL_CLEAR

@@ -149,6 +153,10 @@
#include <linux/interrupt.h>
#include <linux/init.h>

+#ifdef CONFIG_MCA
+static int slow_floppy = 0;
+#endif
+
#include <asm/dma.h>
#include <asm/irq.h>
#include <asm/system.h>
@@ -1300,6 +1308,11 @@

/* Convert step rate from microseconds to milliseconds and 4 bits */
srt = 16 - (DP->srt*scale_dtr/1000 + NOMINAL_DTR - 1)/NOMINAL_DTR;
+#ifdef CONFIG_MCA
+ if( slow_floppy ) {
+ srt = srt / 4;
+ }
+#endif
SUPBOUND(srt, 0xf);
INFBOUND(srt, 0);

@@ -4026,7 +4039,18 @@
{
int i;
int param;
- if (str)
+ if (str) {
+#ifdef CONFIG_MCA
+ /*
+ * PS/2 floppies have much slower step rates than regular floppies.
+ * It's been recommended that take about 1/4 of the default speed
+ * in some more extreme cases.
+ */
+ if( strcmp(str,"slow") == 0) {
+ slow_floppy = 1;
+ return;
+ }
+#endif
for (i=0; i< ARRAY_SIZE(config_params); i++){
if (strcmp(str,config_params[i].name) == 0){
if (ints[0])
@@ -4044,6 +4068,7 @@
return;
}
}
+ }
if (str) {
DPRINT("unknown floppy option [%s]\n", str);

-----

--- linux-2.1.122/init/main.c Wed Sep 16 22:25:57 1998
+++ linux-2.1.122mca/init/main.c Wed Sep 30 11:52:26 1998
@@ -455,6 +456,7 @@
#endif
#ifdef CONFIG_BLK_DEV_PS2
{ "eda", 0x2400 },
+ { "edb", 0x2440 },
#endif
#ifdef CONFIG_PARIDE_PD
{ "pda", 0x2d00 },
@@ -663,7 +668,8 @@
{ "floppy=", floppy_setup },
#endif
#ifdef CONFIG_BLK_DEV_PS2
- { "ed=", ed_setup },
+ { "eda=", ed_setup },
+ { "edb=", ed_setup },
{ "tp720=", tp720_setup },
#endif
#ifdef CONFIG_CDU31A

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/