patch-2.4.19 linux-2.4.19/drivers/char/serial167.c
Next file: linux-2.4.19/drivers/char/serial_21285.c
Previous file: linux-2.4.19/drivers/char/serial.c
Back to the patch index
Back to the overall index
- Lines: 127
- Date:
Fri Aug 2 17:39:43 2002
- Orig file:
linux-2.4.18/drivers/char/serial167.c
- Orig date:
Sun Sep 16 21:23:07 2001
diff -urN linux-2.4.18/drivers/char/serial167.c linux-2.4.19/drivers/char/serial167.c
@@ -1262,7 +1262,7 @@
break;
}
- cli();
+ save_flags(flags); cli();
c = MIN(c, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
SERIAL_XMIT_SIZE - info->xmit_head));
memcpy(info->xmit_buf + info->xmit_head, tmp_buf, c);
@@ -1277,7 +1277,7 @@
up(&tmp_buf_sem);
} else {
while (1) {
- cli();
+ save_flags(flags); cli();
c = MIN(count, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
SERIAL_XMIT_SIZE - info->xmit_head));
if (c <= 0) {
@@ -1377,7 +1377,7 @@
#ifdef SERIAL_DEBUG_THROTTLE
char buf[64];
- printk("throttle %s: %d....\n", _tty_name(tty, buf),
+ printk("throttle %s: %d....\n", tty_name(tty, buf),
tty->ldisc.chars_in_buffer(tty));
printk("cy_throttle ttyS%d\n", info->line);
#endif
@@ -1413,7 +1413,7 @@
#ifdef SERIAL_DEBUG_THROTTLE
char buf[64];
- printk("throttle %s: %d....\n", _tty_name(tty, buf),
+ printk("throttle %s: %d....\n", tty_name(tty, buf),
tty->ldisc.chars_in_buffer(tty));
printk("cy_unthrottle ttyS%d\n", info->line);
#endif
@@ -2395,7 +2395,11 @@
memset(&cy_serial_driver, 0, sizeof(struct tty_driver));
cy_serial_driver.magic = TTY_DRIVER_MAGIC;
+#ifdef CONFIG_DEVFS_FS
+ cy_serial_driver.name = "tts/%d";
+#else
cy_serial_driver.name = "ttyS";
+#endif
cy_serial_driver.major = TTY_MAJOR;
cy_serial_driver.minor_start = 64;
cy_serial_driver.num = NR_PORTS;
@@ -2430,7 +2434,11 @@
* major number and the subtype code.
*/
cy_callout_driver = cy_serial_driver;
+#ifdef CONFIG_DEVFS_FS
+ cy_callout_driver.name = "cua/%d";
+#else
cy_callout_driver.name = "cua";
+#endif
cy_callout_driver.major = TTYAUX_MAJOR;
cy_callout_driver.subtype = SERIAL_TYPE_CALLOUT;
@@ -2806,58 +2814,6 @@
restore_flags(flags);
}
-/* This is a hack; if there are multiple chars waiting in the chip we
- * discard all but the last one, and return that. The cd2401 is not really
- * designed to be driven in polled mode.
- */
-
-int serial167_console_wait_key(struct console *co)
-{
- volatile unsigned char *base_addr = (u_char *)BASE_ADDR;
- unsigned long flags;
- volatile u_char sink;
- u_char ier;
- int port;
- int keypress = 0;
-
- save_flags(flags); cli();
-
- /* Ensure receiver is enabled! */
-
- port = 0;
- base_addr[CyCAR] = (u_char)port;
- while (base_addr[CyCCR])
- ;
- base_addr[CyCCR] = CyENB_RCVR;
- ier = base_addr[CyIER];
- base_addr[CyIER] = CyRxData;
-
- while (!keypress) {
- if (pcc2chip[PccSCCRICR] & 0x20)
- {
- /* We have an Rx int. Acknowledge it */
- sink = pcc2chip[PccRPIACKR];
- if ((base_addr[CyLICR] >> 2) == port) {
- int cnt = base_addr[CyRFOC];
- while (cnt-- > 0)
- {
- keypress = base_addr[CyRDR];
- }
- base_addr[CyREOIR] = 0;
- }
- else
- base_addr[CyREOIR] = CyNOTRANS;
- }
- }
-
- base_addr[CyIER] = ier;
-
- restore_flags(flags);
-
- return keypress;
-}
-
-
static kdev_t serial167_console_device(struct console *c)
{
return MKDEV(TTY_MAJOR, 64 + c->index);
@@ -2874,7 +2830,6 @@
name: "ttyS",
write: serial167_console_write,
device: serial167_console_device,
- wait_key: serial167_console_wait_key,
setup: serial167_console_setup,
flags: CON_PRINTBUFFER,
index: -1,
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)