patch-2.1.124 linux/drivers/block/floppy.c
Next file: linux/drivers/block/ide-pci.c
Previous file: linux/drivers/block/Config.in
Back to the patch index
Back to the overall index
- Lines: 56
- Date:
Wed Sep 30 15:58:53 1998
- Orig file:
v2.1.123/linux/drivers/block/floppy.c
- Orig date:
Thu Sep 17 17:53:35 1998
diff -u --recursive --new-file v2.1.123/linux/drivers/block/floppy.c linux/drivers/block/floppy.c
@@ -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,8 @@
#include <linux/interrupt.h>
#include <linux/init.h>
+static int slow_floppy = 0;
+
#include <asm/dma.h>
#include <asm/irq.h>
#include <asm/system.h>
@@ -1300,6 +1306,9 @@
/* Convert step rate from microseconds to milliseconds and 4 bits */
srt = 16 - (DP->srt*scale_dtr/1000 + NOMINAL_DTR - 1)/NOMINAL_DTR;
+ if( slow_floppy ) {
+ srt = srt / 4;
+ }
SUPBOUND(srt, 0xf);
INFBOUND(srt, 0);
@@ -4026,7 +4035,16 @@
{
int i;
int param;
- if (str)
+ if (str) {
+ /*
+ * 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;
+ }
for (i=0; i< ARRAY_SIZE(config_params); i++){
if (strcmp(str,config_params[i].name) == 0){
if (ints[0])
@@ -4044,6 +4062,7 @@
return;
}
}
+ }
if (str) {
DPRINT("unknown floppy option [%s]\n", str);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov