patch-2.2.18 linux/drivers/char/dtlk.c
Next file: linux/drivers/char/epca.c
Previous file: linux/drivers/char/drm/vm.c
Back to the patch index
Back to the overall index
- Lines: 87
- Date:
Mon Oct 2 10:14:40 2000
- Orig file:
v2.2.17/drivers/char/dtlk.c
- Orig date:
Sat Sep 9 18:42:35 2000
diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/drivers/char/dtlk.c linux/drivers/char/dtlk.c
@@ -61,7 +61,7 @@
#include <linux/mm.h> /* for verify_area */
#include <linux/errno.h> /* for -EBUSY */
#include <linux/ioport.h> /* for check_region, request_region */
-#include <linux/delay.h> /* for loops_per_sec */
+#include <linux/delay.h> /* for loops_per_jiffy */
#include <asm/segment.h> /* for put_user_byte */
#include <asm/io.h> /* for inb_p, outb_p, inb, outb, etc. */
#include <asm/uaccess.h> /* for get_user, etc. */
@@ -154,7 +154,7 @@
if (minor != DTLK_MINOR || !dtlk_has_indexing)
return -EINVAL;
- for (retries = 0; retries < loops_per_sec / 10; retries++) {
+ for (retries = 0; retries < 10000000; retries++) {
while (i < count && dtlk_readable()) {
ch = dtlk_read_lpc();
/* printk("dtlk_read() reads 0x%02x\n", ch); */
@@ -168,7 +168,7 @@
break;
dtlk_delay(10);
}
- if (retries == loops_per_sec)
+ if (retries == 10000000)
printk(KERN_ERR "dtlk_read times out\n");
TRACE_RET;
return -EAGAIN;
@@ -222,7 +222,7 @@
up to 250 usec for the RDY bit to
go nonzero. */
for (retries = 0;
- retries < loops_per_sec / 4000;
+ retries < 25000;
retries++)
if (inb_p(dtlk_port_tts) &
TTS_WRITABLE)
@@ -479,7 +479,7 @@
for (i = 0; i < 10; i++) \
{ \
buffer[b++] = inb_p(dtlk_port_lpc); \
- __delay(loops_per_sec/1000000); \
+ udelay(1); \
}
char buffer[1000];
int b = 0, i, j;
@@ -490,7 +490,7 @@
LOOK
dtlk_write_bytes("\0012I\r", 4);
buffer[b++] = 0;
- __delay(50 * loops_per_sec / 1000);
+ mdelay(50);
outb_p(0xff, dtlk_port_lpc);
buffer[b++] = 0;
LOOK
@@ -509,12 +509,12 @@
for (i = 0; i < 10; i++) \
{ \
buffer[b++] = inb_p(dtlk_port_tts); \
- __delay(loops_per_sec/1000000); /* 1 us */ \
+ udelay(1); \
}
char buffer[1000];
int b = 0, i, j;
- __delay(loops_per_sec / 100); /* 10 ms */
+ mdelay(10);
LOOK
outb_p(0x03, dtlk_port_tts);
buffer[b++] = 0;
@@ -646,7 +646,7 @@
/* acknowledging a read takes 3-4
usec. Here, we wait up to 20 usec
for the acknowledgement */
- retries = (loops_per_sec * 20) / 1000000;
+ retries = 2000;
while (inb_p(dtlk_port_lpc) != 0x7f && --retries > 0);
if (retries == 0)
printk(KERN_ERR "dtlk_read_lpc() timeout\n");
@@ -704,7 +704,7 @@
/* the RDY bit goes zero 2-3 usec after writing, and goes
1 again 180-190 usec later. Here, we wait up to 10
usec for the RDY bit to go zero. */
- for (retries = 0; retries < loops_per_sec / 100000; retries++)
+ for (retries = 0; retries < 1000; retries++)
if ((inb_p(dtlk_port_tts) & TTS_WRITABLE) == 0)
break;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)