2 * Simulated Serial Driver (fake serial)
4 * This driver is mostly used for bringup purposes and will go away.
5 * It has a strong dependency on the system console. All outputs
6 * are rerouted to the same facility as the one used by printk which, in our
7 * case means sys_sim.c console (goes via the simulator). The code hereafter
8 * is completely leveraged from the serial.c driver.
10 * Copyright (C) 1999-2000, 2002-2003 Hewlett-Packard Co
11 * Stephane Eranian <eranian@hpl.hp.com>
12 * David Mosberger-Tang <davidm@hpl.hp.com>
14 * 02/04/00 D. Mosberger Merged in serial.c bug fixes in rs_close().
15 * 02/25/00 D. Mosberger Synced up with 2.3.99pre-5 version of serial.c.
16 * 07/30/02 D. Mosberger Replace sti()/cli() with explicit spinlocks & local irq masking
19 #include <linux/init.h>
20 #include <linux/errno.h>
21 #include <linux/sched.h>
22 #include <linux/tty.h>
23 #include <linux/tty_flip.h>
24 #include <linux/major.h>
25 #include <linux/fcntl.h>
27 #include <linux/slab.h>
28 #include <linux/capability.h>
29 #include <linux/console.h>
30 #include <linux/module.h>
31 #include <linux/serial.h>
32 #include <linux/serialP.h>
33 #include <linux/sysrq.h>
36 #include <asm/hw_irq.h>
37 #include <asm/uaccess.h>
39 #undef SIMSERIAL_DEBUG /* define this to get some debug information */
41 #define KEYBOARD_INTR 3 /* must match with simulator! */
43 #define NR_PORTS 1 /* only one port for now */
45 #define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? IRQF_SHARED : IRQF_DISABLED)
47 #define SSC_GETCHAR 21
49 extern long ia64_ssc (long, long, long, long, int);
50 extern void ia64_ssc_connect_irq (long intr, long irq);
52 static char *serial_name = "SimSerial driver";
53 static char *serial_version = "0.6";
56 * This has been extracted from asm/serial.h. We need one eventually but
57 * I don't know exactly what we're going to put in it so just fake one
60 #define BASE_BAUD ( 1843200 / 16 )
62 #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
65 * Most of the values here are meaningless to this particular driver.
66 * However some values must be preserved for the code (leveraged from serial.c
69 * type must not be UNKNOWN
70 * So I picked arbitrary (guess from where?) values instead
72 static struct serial_state rs_table[NR_PORTS]={
73 /* UART CLK PORT IRQ FLAGS */
74 { 0, BASE_BAUD, 0x3F8, 0, STD_COM_FLAGS,0,PORT_16550 } /* ttyS0 */
78 * Just for the fun of it !
80 static struct serial_uart_config uart_config[] = {
85 { "16550A", 16, UART_CLEAR_FIFO | UART_USE_FIFO },
87 { "ST16650", 1, UART_CLEAR_FIFO | UART_STARTECH },
88 { "ST16650V2", 32, UART_CLEAR_FIFO | UART_USE_FIFO |
90 { "TI16750", 64, UART_CLEAR_FIFO | UART_USE_FIFO},
94 struct tty_driver *hp_simserial_driver;
96 static struct async_struct *IRQ_ports[NR_IRQS];
98 static struct console *console;
100 static unsigned char *tmp_buf;
102 extern struct console *console_drivers; /* from kernel/printk.c */
105 * ------------------------------------------------------------
106 * rs_stop() and rs_start()
108 * This routines are called before setting or resetting tty->stopped.
109 * They enable or disable transmitter interrupts, as necessary.
110 * ------------------------------------------------------------
112 static void rs_stop(struct tty_struct *tty)
114 #ifdef SIMSERIAL_DEBUG
115 printk("rs_stop: tty->stopped=%d tty->hw_stopped=%d tty->flow_stopped=%d\n",
116 tty->stopped, tty->hw_stopped, tty->flow_stopped);
121 static void rs_start(struct tty_struct *tty)
123 #ifdef SIMSERIAL_DEBUG
124 printk("rs_start: tty->stopped=%d tty->hw_stopped=%d tty->flow_stopped=%d\n",
125 tty->stopped, tty->hw_stopped, tty->flow_stopped);
129 static void receive_chars(struct tty_struct *tty)
132 static unsigned char seen_esc = 0;
134 while ( (ch = ia64_ssc(0, 0, 0, 0, SSC_GETCHAR)) ) {
135 if ( ch == 27 && seen_esc == 0 ) {
139 if ( seen_esc==1 && ch == 'O' ) {
142 } else if ( seen_esc == 2 ) {
143 if ( ch == 'P' ) /* F1 */
145 #ifdef CONFIG_MAGIC_SYSRQ
146 if ( ch == 'S' ) { /* F4 */
148 ch = ia64_ssc(0, 0, 0, 0,
151 handle_sysrq(ch, NULL);
160 if (tty_insert_flip_char(tty, ch, TTY_NORMAL) == 0)
163 tty_flip_buffer_push(tty);
167 * This is the serial driver's interrupt routine for a single port
169 static irqreturn_t rs_interrupt_single(int irq, void *dev_id)
171 struct async_struct * info;
174 * I don't know exactly why they don't use the dev_id opaque data
175 * pointer instead of this extra lookup table
177 info = IRQ_ports[irq];
178 if (!info || !info->tty) {
179 printk(KERN_INFO "simrs_interrupt_single: info|tty=0 info=%p problem\n", info);
183 * pretty simple in our case, because we only get interrupts
186 receive_chars(info->tty);
191 * -------------------------------------------------------------------
192 * Here ends the serial interrupt routines.
193 * -------------------------------------------------------------------
196 static void do_softint(struct work_struct *private_)
198 printk(KERN_ERR "simserial: do_softint called\n");
201 static int rs_put_char(struct tty_struct *tty, unsigned char ch)
203 struct async_struct *info = (struct async_struct *)tty->driver_data;
206 if (!tty || !info->xmit.buf)
209 local_irq_save(flags);
210 if (CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE) == 0) {
211 local_irq_restore(flags);
214 info->xmit.buf[info->xmit.head] = ch;
215 info->xmit.head = (info->xmit.head + 1) & (SERIAL_XMIT_SIZE-1);
216 local_irq_restore(flags);
220 static void transmit_chars(struct async_struct *info, int *intr_done)
226 local_irq_save(flags);
229 char c = info->x_char;
231 console->write(console, &c, 1);
233 info->state->icount.tx++;
239 if (info->xmit.head == info->xmit.tail || info->tty->stopped || info->tty->hw_stopped) {
240 #ifdef SIMSERIAL_DEBUG
241 printk("transmit_chars: head=%d, tail=%d, stopped=%d\n",
242 info->xmit.head, info->xmit.tail, info->tty->stopped);
247 * We removed the loop and try to do it in to chunks. We need
248 * 2 operations maximum because it's a ring buffer.
250 * First from current to tail if possible.
251 * Then from the beginning of the buffer until necessary
254 count = min(CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE),
255 SERIAL_XMIT_SIZE - info->xmit.tail);
256 console->write(console, info->xmit.buf+info->xmit.tail, count);
258 info->xmit.tail = (info->xmit.tail+count) & (SERIAL_XMIT_SIZE-1);
261 * We have more at the beginning of the buffer
263 count = CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
265 console->write(console, info->xmit.buf, count);
266 info->xmit.tail += count;
269 local_irq_restore(flags);
272 static void rs_flush_chars(struct tty_struct *tty)
274 struct async_struct *info = (struct async_struct *)tty->driver_data;
276 if (info->xmit.head == info->xmit.tail || tty->stopped || tty->hw_stopped ||
280 transmit_chars(info, NULL);
284 static int rs_write(struct tty_struct * tty,
285 const unsigned char *buf, int count)
288 struct async_struct *info = (struct async_struct *)tty->driver_data;
291 if (!tty || !info->xmit.buf || !tmp_buf) return 0;
293 local_irq_save(flags);
295 c = CIRC_SPACE_TO_END(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
301 memcpy(info->xmit.buf + info->xmit.head, buf, c);
302 info->xmit.head = ((info->xmit.head + c) &
303 (SERIAL_XMIT_SIZE-1));
308 local_irq_restore(flags);
310 * Hey, we transmit directly from here in our case
312 if (CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE)
313 && !tty->stopped && !tty->hw_stopped) {
314 transmit_chars(info, NULL);
319 static int rs_write_room(struct tty_struct *tty)
321 struct async_struct *info = (struct async_struct *)tty->driver_data;
323 return CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
326 static int rs_chars_in_buffer(struct tty_struct *tty)
328 struct async_struct *info = (struct async_struct *)tty->driver_data;
330 return CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
333 static void rs_flush_buffer(struct tty_struct *tty)
335 struct async_struct *info = (struct async_struct *)tty->driver_data;
338 local_irq_save(flags);
339 info->xmit.head = info->xmit.tail = 0;
340 local_irq_restore(flags);
346 * This function is used to send a high-priority XON/XOFF character to
349 static void rs_send_xchar(struct tty_struct *tty, char ch)
351 struct async_struct *info = (struct async_struct *)tty->driver_data;
356 * I guess we could call console->write() directly but
357 * let's do that for now.
359 transmit_chars(info, NULL);
364 * ------------------------------------------------------------
367 * This routine is called by the upper-layer tty layer to signal that
368 * incoming characters should be throttled.
369 * ------------------------------------------------------------
371 static void rs_throttle(struct tty_struct * tty)
373 if (I_IXOFF(tty)) rs_send_xchar(tty, STOP_CHAR(tty));
375 printk(KERN_INFO "simrs_throttle called\n");
378 static void rs_unthrottle(struct tty_struct * tty)
380 struct async_struct *info = (struct async_struct *)tty->driver_data;
386 rs_send_xchar(tty, START_CHAR(tty));
388 printk(KERN_INFO "simrs_unthrottle called\n");
392 static int rs_ioctl(struct tty_struct *tty, struct file * file,
393 unsigned int cmd, unsigned long arg)
395 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
396 (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) &&
397 (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
398 if (tty->flags & (1 << TTY_IO_ERROR))
404 printk(KERN_INFO "simrs_ioctl TIOCGSERIAL called\n");
407 printk(KERN_INFO "simrs_ioctl TIOCSSERIAL called\n");
410 printk(KERN_INFO "rs_ioctl: TIOCSERCONFIG called\n");
413 case TIOCSERGETLSR: /* Get line status register */
414 printk(KERN_INFO "rs_ioctl: TIOCSERGETLSR called\n");
418 printk(KERN_INFO "rs_ioctl: TIOCSERGSTRUCT called\n");
420 if (copy_to_user((struct async_struct *) arg,
421 info, sizeof(struct async_struct)))
427 * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change
428 * - mask passed in arg for lines of interest
429 * (use |'ed TIOCM_RNG/DSR/CD/CTS for masking)
430 * Caller should use TIOCGICOUNT to see which one it was
433 printk(KERN_INFO "rs_ioctl: TIOCMIWAIT: called\n");
436 * Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
437 * Return: write counters to the user passed counter struct
438 * NB: both 1->0 and 0->1 transitions are counted except for
439 * RI where only 0->1 is counted.
442 printk(KERN_INFO "rs_ioctl: TIOCGICOUNT called\n");
447 /* "setserial -W" is called in Debian boot */
448 printk (KERN_INFO "TIOCSER?WILD ioctl obsolete, ignored.\n");
457 #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
459 static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
461 /* Handle turning off CRTSCTS */
462 if ((old_termios->c_cflag & CRTSCTS) &&
463 !(tty->termios->c_cflag & CRTSCTS)) {
469 * This routine will shutdown a serial port; interrupts are disabled, and
470 * DTR is dropped if the hangup on close termio flag is on.
472 static void shutdown(struct async_struct * info)
475 struct serial_state *state;
478 if (!(info->flags & ASYNC_INITIALIZED)) return;
482 #ifdef SIMSERIAL_DEBUG
483 printk("Shutting down serial port %d (irq %d)....", info->line,
487 local_irq_save(flags);
490 * First unlink the serial port from the IRQ chain...
493 info->next_port->prev_port = info->prev_port;
495 info->prev_port->next_port = info->next_port;
497 IRQ_ports[state->irq] = info->next_port;
500 * Free the IRQ, if necessary
502 if (state->irq && (!IRQ_ports[state->irq] ||
503 !IRQ_ports[state->irq]->next_port)) {
504 if (IRQ_ports[state->irq]) {
505 free_irq(state->irq, NULL);
506 retval = request_irq(state->irq, rs_interrupt_single,
507 IRQ_T(info), "serial", NULL);
510 printk(KERN_ERR "serial shutdown: request_irq: error %d"
511 " Couldn't reacquire IRQ.\n", retval);
513 free_irq(state->irq, NULL);
516 if (info->xmit.buf) {
517 free_page((unsigned long) info->xmit.buf);
518 info->xmit.buf = NULL;
521 if (info->tty) set_bit(TTY_IO_ERROR, &info->tty->flags);
523 info->flags &= ~ASYNC_INITIALIZED;
525 local_irq_restore(flags);
529 * ------------------------------------------------------------
532 * This routine is called when the serial port gets closed. First, we
533 * wait for the last remaining data to be sent. Then, we unlink its
534 * async structure from the interrupt chain if necessary, and we free
535 * that IRQ if nothing is left in the chain.
536 * ------------------------------------------------------------
538 static void rs_close(struct tty_struct *tty, struct file * filp)
540 struct async_struct * info = (struct async_struct *)tty->driver_data;
541 struct serial_state *state;
548 local_irq_save(flags);
549 if (tty_hung_up_p(filp)) {
550 #ifdef SIMSERIAL_DEBUG
551 printk("rs_close: hung_up\n");
553 local_irq_restore(flags);
556 #ifdef SIMSERIAL_DEBUG
557 printk("rs_close ttys%d, count = %d\n", info->line, state->count);
559 if ((tty->count == 1) && (state->count != 1)) {
561 * Uh, oh. tty->count is 1, which means that the tty
562 * structure will be freed. state->count should always
563 * be one in these conditions. If it's greater than
564 * one, we've got real problems, since it means the
565 * serial port won't be shutdown.
567 printk(KERN_ERR "rs_close: bad serial port count; tty->count is 1, "
568 "state->count is %d\n", state->count);
571 if (--state->count < 0) {
572 printk(KERN_ERR "rs_close: bad serial port count for ttys%d: %d\n",
573 info->line, state->count);
577 local_irq_restore(flags);
580 info->flags |= ASYNC_CLOSING;
581 local_irq_restore(flags);
584 * Now we wait for the transmit buffer to clear; and we notify
585 * the line discipline to only process XON/XOFF characters.
588 rs_flush_buffer(tty);
589 tty_ldisc_flush(tty);
592 if (info->blocked_open) {
593 if (info->close_delay)
594 schedule_timeout_interruptible(info->close_delay);
595 wake_up_interruptible(&info->open_wait);
597 info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
598 wake_up_interruptible(&info->close_wait);
602 * rs_wait_until_sent() --- wait until the transmitter is empty
604 static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
610 * rs_hangup() --- called by tty_hangup() when a hangup is signaled.
612 static void rs_hangup(struct tty_struct *tty)
614 struct async_struct * info = (struct async_struct *)tty->driver_data;
615 struct serial_state *state = info->state;
617 #ifdef SIMSERIAL_DEBUG
618 printk("rs_hangup: called\n");
623 rs_flush_buffer(tty);
624 if (info->flags & ASYNC_CLOSING)
630 info->flags &= ~ASYNC_NORMAL_ACTIVE;
632 wake_up_interruptible(&info->open_wait);
636 static int get_async_struct(int line, struct async_struct **ret_info)
638 struct async_struct *info;
639 struct serial_state *sstate;
641 sstate = rs_table + line;
644 *ret_info = sstate->info;
647 info = kzalloc(sizeof(struct async_struct), GFP_KERNEL);
652 init_waitqueue_head(&info->open_wait);
653 init_waitqueue_head(&info->close_wait);
654 init_waitqueue_head(&info->delta_msr_wait);
655 info->magic = SERIAL_MAGIC;
656 info->port = sstate->port;
657 info->flags = sstate->flags;
658 info->xmit_fifo_size = sstate->xmit_fifo_size;
660 INIT_WORK(&info->work, do_softint);
661 info->state = sstate;
664 *ret_info = sstate->info;
667 *ret_info = sstate->info = info;
672 startup(struct async_struct *info)
676 irq_handler_t handler;
677 struct serial_state *state= info->state;
680 page = get_zeroed_page(GFP_KERNEL);
684 local_irq_save(flags);
686 if (info->flags & ASYNC_INITIALIZED) {
691 if (!state->port || !state->type) {
692 if (info->tty) set_bit(TTY_IO_ERROR, &info->tty->flags);
699 info->xmit.buf = (unsigned char *) page;
701 #ifdef SIMSERIAL_DEBUG
702 printk("startup: ttys%d (irq %d)...", info->line, state->irq);
706 * Allocate the IRQ if necessary
708 if (state->irq && (!IRQ_ports[state->irq] ||
709 !IRQ_ports[state->irq]->next_port)) {
710 if (IRQ_ports[state->irq]) {
714 handler = rs_interrupt_single;
716 retval = request_irq(state->irq, handler, IRQ_T(info), "simserial", NULL);
718 if (capable(CAP_SYS_ADMIN)) {
720 set_bit(TTY_IO_ERROR,
729 * Insert serial port into IRQ chain.
731 info->prev_port = NULL;
732 info->next_port = IRQ_ports[state->irq];
734 info->next_port->prev_port = info;
735 IRQ_ports[state->irq] = info;
737 if (info->tty) clear_bit(TTY_IO_ERROR, &info->tty->flags);
739 info->xmit.head = info->xmit.tail = 0;
743 * Set up serial timers...
745 timer_table[RS_TIMER].expires = jiffies + 2*HZ/100;
746 timer_active |= 1 << RS_TIMER;
750 * Set up the tty->alt_speed kludge
753 if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
754 info->tty->alt_speed = 57600;
755 if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
756 info->tty->alt_speed = 115200;
757 if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)
758 info->tty->alt_speed = 230400;
759 if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
760 info->tty->alt_speed = 460800;
763 info->flags |= ASYNC_INITIALIZED;
764 local_irq_restore(flags);
768 local_irq_restore(flags);
774 * This routine is called whenever a serial port is opened. It
775 * enables interrupts for a serial port, linking in its async structure into
776 * the IRQ chain. It also performs the serial-specific
777 * initialization for the tty structure.
779 static int rs_open(struct tty_struct *tty, struct file * filp)
781 struct async_struct *info;
786 if ((line < 0) || (line >= NR_PORTS))
788 retval = get_async_struct(line, &info);
791 tty->driver_data = info;
794 #ifdef SIMSERIAL_DEBUG
795 printk("rs_open %s, count = %d\n", tty->name, info->state->count);
797 info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
800 page = get_zeroed_page(GFP_KERNEL);
806 tmp_buf = (unsigned char *) page;
810 * If the port is the middle of closing, bail out now
812 if (tty_hung_up_p(filp) ||
813 (info->flags & ASYNC_CLOSING)) {
814 if (info->flags & ASYNC_CLOSING)
815 interruptible_sleep_on(&info->close_wait);
816 #ifdef SERIAL_DO_RESTART
817 return ((info->flags & ASYNC_HUP_NOTIFY) ?
818 -EAGAIN : -ERESTARTSYS);
825 * Start up serial port
827 retval = startup(info);
833 * figure out which console to use (should be one already)
835 console = console_drivers;
837 if ((console->flags & CON_ENABLED) && console->write) break;
838 console = console->next;
841 #ifdef SIMSERIAL_DEBUG
842 printk("rs_open ttys%d successful\n", info->line);
848 * /proc fs routines....
851 static inline int line_info(char *buf, struct serial_state *state)
853 return sprintf(buf, "%d: uart:%s port:%lX irq:%d\n",
854 state->line, uart_config[state->type].name,
855 state->port, state->irq);
858 static int rs_read_proc(char *page, char **start, off_t off, int count,
859 int *eof, void *data)
864 len += sprintf(page, "simserinfo:1.0 driver:%s\n", serial_version);
865 for (i = 0; i < NR_PORTS && len < 4000; i++) {
866 l = line_info(page + len, &rs_table[i]);
868 if (len+begin > off+count)
870 if (len+begin < off) {
877 if (off >= len+begin)
879 *start = page + (begin-off);
880 return ((count < begin+len-off) ? count : begin+len-off);
884 * ---------------------------------------------------------------------
885 * rs_init() and friends
887 * rs_init() is called at boot-time to initialize the serial driver.
888 * ---------------------------------------------------------------------
892 * This routine prints out the appropriate serial driver version
893 * number, and identifies which options were configured into this
896 static inline void show_serial_version(void)
898 printk(KERN_INFO "%s version %s with", serial_name, serial_version);
899 printk(KERN_INFO " no serial options enabled\n");
902 static const struct tty_operations hp_ops = {
906 .put_char = rs_put_char,
907 .flush_chars = rs_flush_chars,
908 .write_room = rs_write_room,
909 .chars_in_buffer = rs_chars_in_buffer,
910 .flush_buffer = rs_flush_buffer,
912 .throttle = rs_throttle,
913 .unthrottle = rs_unthrottle,
914 .send_xchar = rs_send_xchar,
915 .set_termios = rs_set_termios,
919 .wait_until_sent = rs_wait_until_sent,
920 .read_proc = rs_read_proc,
924 * The serial driver boot-time initialization code!
930 struct serial_state *state;
932 if (!ia64_platform_is("hpsim"))
935 hp_simserial_driver = alloc_tty_driver(1);
936 if (!hp_simserial_driver)
939 show_serial_version();
941 /* Initialize the tty_driver structure */
943 hp_simserial_driver->owner = THIS_MODULE;
944 hp_simserial_driver->driver_name = "simserial";
945 hp_simserial_driver->name = "ttyS";
946 hp_simserial_driver->major = TTY_MAJOR;
947 hp_simserial_driver->minor_start = 64;
948 hp_simserial_driver->type = TTY_DRIVER_TYPE_SERIAL;
949 hp_simserial_driver->subtype = SERIAL_TYPE_NORMAL;
950 hp_simserial_driver->init_termios = tty_std_termios;
951 hp_simserial_driver->init_termios.c_cflag =
952 B9600 | CS8 | CREAD | HUPCL | CLOCAL;
953 hp_simserial_driver->flags = TTY_DRIVER_REAL_RAW;
954 tty_set_operations(hp_simserial_driver, &hp_ops);
957 * Let's have a little bit of fun !
959 for (i = 0, state = rs_table; i < NR_PORTS; i++,state++) {
961 if (state->type == PORT_UNKNOWN) continue;
964 if ((rc = assign_irq_vector(AUTO_ASSIGN)) < 0)
965 panic("%s: out of interrupt vectors!\n",
968 ia64_ssc_connect_irq(KEYBOARD_INTR, state->irq);
971 printk(KERN_INFO "ttyS%d at 0x%04lx (irq = %d) is a %s\n",
973 state->port, state->irq,
974 uart_config[state->type].name);
977 if (tty_register_driver(hp_simserial_driver))
978 panic("Couldn't register simserial driver\n");
984 __initcall(simrs_init);