4 * Copyright (C) 1998/1999 R.E.Wolff@BitWizard.nl
6 * written for the SX serial driver.
7 * Contains the code that should be shared over all the serial drivers.
9 * Credit for the idea to do it this way might go to Alan Cox.
12 * Version 0.1 -- December, 1998. Initial version.
13 * Version 0.2 -- March, 1999. Some more routines. Bugfixes. Etc.
14 * Version 0.5 -- August, 1999. Some more fixes. Reformat for Linus.
16 * BitWizard is actively maintaining this file. We sometimes find
17 * that someone submitted changes to this file. We really appreciate
18 * your help, but please submit changes through us. We're doing our
19 * best to be responsive. -- REW
22 #include <linux/module.h>
23 #include <linux/kernel.h>
24 #include <linux/tty.h>
25 #include <linux/serial.h>
27 #include <linux/generic_serial.h>
28 #include <linux/interrupt.h>
29 #include <linux/delay.h>
30 #include <asm/semaphore.h>
31 #include <asm/uaccess.h>
35 static char * tmp_buf;
36 static DECLARE_MUTEX(tmp_buf_sem);
41 #define gs_dprintk(f, str...) if (gs_debug & f) printk (str)
43 #define gs_dprintk(f, str...) /* nothing */
46 #define func_enter() gs_dprintk (GS_DEBUG_FLOW, "gs: enter %s\n", __FUNCTION__)
47 #define func_exit() gs_dprintk (GS_DEBUG_FLOW, "gs: exit %s\n", __FUNCTION__)
49 #ifdef NEW_WRITE_LOCKING
50 #define DECL /* Nothing */
51 #define LOCKIT down (& port->port_write_sem);
52 #define RELEASEIT up (&port->port_write_sem);
54 #define DECL unsigned long flags;
55 #define LOCKIT save_flags (flags);cli ()
56 #define RELEASEIT restore_flags (flags)
59 #define RS_EVENT_WRITE_WAKEUP 1
61 module_param(gs_debug, int, 0644);
64 void gs_put_char(struct tty_struct * tty, unsigned char ch)
73 port = tty->driver_data;
77 if (! (port->flags & ASYNC_INITIALIZED)) return;
79 /* Take a lock on the serial tranmit buffer! */
82 if (port->xmit_cnt >= SERIAL_XMIT_SIZE - 1) {
83 /* Sorry, buffer is full, drop character. Update statistics???? -- REW */
88 port->xmit_buf[port->xmit_head++] = ch;
89 port->xmit_head &= SERIAL_XMIT_SIZE - 1;
90 port->xmit_cnt++; /* Characters in buffer */
97 #ifdef NEW_WRITE_LOCKING
100 > Problems to take into account are:
101 > -1- Interrupts that empty part of the buffer.
102 > -2- page faults on the access to userspace.
103 > -3- Other processes that are also trying to do a "write".
106 int gs_write(struct tty_struct * tty,
107 const unsigned char *buf, int count)
109 struct gs_port *port;
117 port = tty->driver_data;
121 if (! (port->flags & ASYNC_INITIALIZED))
124 /* get exclusive "write" access to this port (problem 3) */
125 /* This is not a spinlock because we can have a disk access (page
126 fault) in copy_from_user */
127 down (& port->port_write_sem);
133 /* This is safe because we "OWN" the "head". Noone else can
134 change the "head": we own the port_write_sem. */
135 /* Don't overrun the end of the buffer */
136 t = SERIAL_XMIT_SIZE - port->xmit_head;
139 /* This is safe because the xmit_cnt can only decrease. This
140 would increase "t", so we might copy too little chars. */
141 /* Don't copy past the "head" of the buffer */
142 t = SERIAL_XMIT_SIZE - 1 - port->xmit_cnt;
145 /* Can't copy more? break out! */
148 memcpy (port->xmit_buf + port->xmit_head, buf, c);
150 port -> xmit_cnt += c;
151 port -> xmit_head = (port->xmit_head + c) & (SERIAL_XMIT_SIZE -1);
156 up (& port->port_write_sem);
158 gs_dprintk (GS_DEBUG_WRITE, "write: interrupts are %s\n",
159 (port->flags & GS_TX_INTEN)?"enabled": "disabled");
161 if (port->xmit_cnt &&
164 !(port->flags & GS_TX_INTEN)) {
165 port->flags |= GS_TX_INTEN;
166 port->rd->enable_tx_interrupts (port);
173 > Problems to take into account are:
174 > -1- Interrupts that empty part of the buffer.
175 > -2- page faults on the access to userspace.
176 > -3- Other processes that are also trying to do a "write".
179 int gs_write(struct tty_struct * tty,
180 const unsigned char *buf, int count)
182 struct gs_port *port;
189 /* The standard serial driver returns 0 in this case.
190 That sounds to me as "No error, I just didn't get to writing any
191 bytes. Feel free to try again."
192 The "official" way to write n bytes from buf is:
194 for (nwritten = 0;nwritten < n;nwritten += rv) {
195 rv = write (fd, buf+nwritten, n-nwritten);
196 if (rv < 0) break; // Error: bail out. //
199 which will loop endlessly in this case. The manual page for write
200 agrees with me. In practise almost everybody writes
201 "write (fd, buf,n);" but some people might have had to deal with
202 incomplete writes in the past and correctly implemented it by now...
205 if (!tty) return -EIO;
207 port = tty->driver_data;
208 if (!port || !port->xmit_buf || !tmp_buf)
216 /* This is safe because we "OWN" the "head". Noone else can
217 change the "head": we own the port_write_sem. */
218 /* Don't overrun the end of the buffer */
219 t = SERIAL_XMIT_SIZE - port->xmit_head;
222 /* This is safe because the xmit_cnt can only decrease. This
223 would increase "t", so we might copy too little chars. */
224 /* Don't copy past the "head" of the buffer */
225 t = SERIAL_XMIT_SIZE - 1 - port->xmit_cnt;
228 /* Can't copy more? break out! */
230 restore_flags(flags);
233 memcpy(port->xmit_buf + port->xmit_head, buf, c);
234 port->xmit_head = ((port->xmit_head + c) &
235 (SERIAL_XMIT_SIZE-1));
237 restore_flags(flags);
243 if (port->xmit_cnt &&
246 !(port->flags & GS_TX_INTEN)) {
247 port->flags |= GS_TX_INTEN;
248 port->rd->enable_tx_interrupts (port);
258 int gs_write_room(struct tty_struct * tty)
260 struct gs_port *port = tty->driver_data;
264 ret = SERIAL_XMIT_SIZE - port->xmit_cnt - 1;
272 int gs_chars_in_buffer(struct tty_struct *tty)
274 struct gs_port *port = tty->driver_data;
278 return port->xmit_cnt;
282 int gs_real_chars_in_buffer(struct tty_struct *tty)
284 struct gs_port *port;
288 port = tty->driver_data;
290 if (!port->rd) return 0;
291 if (!port->rd->chars_in_buffer) return 0;
294 return port->xmit_cnt + port->rd->chars_in_buffer (port);
298 static int gs_wait_tx_flushed (void * ptr, int timeout)
300 struct gs_port *port = ptr;
301 unsigned long end_jiffies;
302 int jiffies_to_transmit, charsleft = 0, rv = 0;
307 gs_dprintk (GS_DEBUG_FLUSH, "port=%p.\n", port);
309 gs_dprintk (GS_DEBUG_FLUSH, "xmit_cnt=%x, xmit_buf=%p, tty=%p.\n",
310 port->xmit_cnt, port->xmit_buf, port->tty);
313 if (!port || port->xmit_cnt < 0 || !port->xmit_buf) {
314 gs_dprintk (GS_DEBUG_FLUSH, "ERROR: !port, !port->xmit_buf or prot->xmit_cnt < 0.\n");
316 return -EINVAL; /* This is an error which we don't know how to handle. */
319 rcib = gs_real_chars_in_buffer(port->tty);
322 gs_dprintk (GS_DEBUG_FLUSH, "nothing to wait for.\n");
326 /* stop trying: now + twice the time it would normally take + seconds */
327 if (timeout == 0) timeout = MAX_SCHEDULE_TIMEOUT;
328 end_jiffies = jiffies;
329 if (timeout != MAX_SCHEDULE_TIMEOUT)
330 end_jiffies += port->baud?(2 * rcib * 10 * HZ / port->baud):0;
331 end_jiffies += timeout;
333 gs_dprintk (GS_DEBUG_FLUSH, "now=%lx, end=%lx (%ld).\n",
334 jiffies, end_jiffies, end_jiffies-jiffies);
336 /* the expression is actually jiffies < end_jiffies, but that won't
337 work around the wraparound. Tricky eh? */
338 while ((charsleft = gs_real_chars_in_buffer (port->tty)) &&
339 time_after (end_jiffies, jiffies)) {
341 chars * (bits/char) * (jiffies /sec) / (bits/sec) = jiffies!
344 charsleft += 16; /* Allow 16 chars more to be transmitted ... */
345 jiffies_to_transmit = port->baud?(1 + charsleft * 10 * HZ / port->baud):0;
346 /* ^^^ Round up.... */
347 if (jiffies_to_transmit <= 0) jiffies_to_transmit = 1;
349 gs_dprintk (GS_DEBUG_FLUSH, "Expect to finish in %d jiffies "
350 "(%d chars).\n", jiffies_to_transmit, charsleft);
352 msleep_interruptible(jiffies_to_msecs(jiffies_to_transmit));
353 if (signal_pending (current)) {
354 gs_dprintk (GS_DEBUG_FLUSH, "Signal pending. Bombing out: ");
360 gs_dprintk (GS_DEBUG_FLUSH, "charsleft = %d.\n", charsleft);
361 set_current_state (TASK_RUNNING);
369 void gs_flush_buffer(struct tty_struct *tty)
371 struct gs_port *port;
378 port = tty->driver_data;
382 /* XXX Would the write semaphore do? */
383 save_flags(flags); cli();
384 port->xmit_cnt = port->xmit_head = port->xmit_tail = 0;
385 restore_flags(flags);
387 wake_up_interruptible(&tty->write_wait);
393 void gs_flush_chars(struct tty_struct * tty)
395 struct gs_port *port;
401 port = tty->driver_data;
405 if (port->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
411 /* Beats me -- REW */
412 port->flags |= GS_TX_INTEN;
413 port->rd->enable_tx_interrupts (port);
418 void gs_stop(struct tty_struct * tty)
420 struct gs_port *port;
426 port = tty->driver_data;
430 if (port->xmit_cnt &&
432 (port->flags & GS_TX_INTEN) ) {
433 port->flags &= ~GS_TX_INTEN;
434 port->rd->disable_tx_interrupts (port);
440 void gs_start(struct tty_struct * tty)
442 struct gs_port *port;
446 port = tty->driver_data;
450 if (port->xmit_cnt &&
452 !(port->flags & GS_TX_INTEN) ) {
453 port->flags |= GS_TX_INTEN;
454 port->rd->enable_tx_interrupts (port);
460 void gs_shutdown_port (struct gs_port *port)
468 if (!(port->flags & ASYNC_INITIALIZED))
474 if (port->xmit_buf) {
475 free_page((unsigned long) port->xmit_buf);
476 port->xmit_buf = NULL;
480 set_bit(TTY_IO_ERROR, &port->tty->flags);
482 port->rd->shutdown_port (port);
484 port->flags &= ~ASYNC_INITIALIZED;
485 restore_flags (flags);
491 void gs_hangup(struct tty_struct *tty)
493 struct gs_port *port;
499 port = tty->driver_data;
504 gs_shutdown_port (port);
505 port->flags &= ~(ASYNC_NORMAL_ACTIVE|GS_ACTIVE);
509 wake_up_interruptible(&port->open_wait);
514 void gs_do_softint(void *private_)
516 struct gs_port *port = private_;
517 struct tty_struct *tty;
527 if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &port->event)) {
529 wake_up_interruptible(&tty->write_wait);
535 int gs_block_til_ready(void *port_, struct file * filp)
537 struct gs_port *port = port_;
538 DECLARE_WAITQUEUE(wait, current);
542 struct tty_struct *tty;
552 gs_dprintk (GS_DEBUG_BTR, "Entering gs_block_till_ready.\n");
554 * If the device is in the middle of being closed, then block
555 * until it's done, and then try again.
557 if (tty_hung_up_p(filp) || port->flags & ASYNC_CLOSING) {
558 interruptible_sleep_on(&port->close_wait);
559 if (port->flags & ASYNC_HUP_NOTIFY)
565 gs_dprintk (GS_DEBUG_BTR, "after hung up\n");
568 * If non-blocking mode is set, or the port is not enabled,
569 * then make the check up front and then exit.
571 if ((filp->f_flags & O_NONBLOCK) ||
572 (tty->flags & (1 << TTY_IO_ERROR))) {
573 port->flags |= ASYNC_NORMAL_ACTIVE;
577 gs_dprintk (GS_DEBUG_BTR, "after nonblock\n");
583 * Block waiting for the carrier detect and the line to become
584 * free (i.e., not in use by the callout). While we are in
585 * this loop, port->count is dropped by one, so that
586 * rs_close() knows when to free things. We restore it upon
587 * exit, either normal or abnormal.
591 add_wait_queue(&port->open_wait, &wait);
593 gs_dprintk (GS_DEBUG_BTR, "after add waitq.\n");
595 if (!tty_hung_up_p(filp))
598 port->blocked_open++;
600 CD = port->rd->get_CD (port);
601 gs_dprintk (GS_DEBUG_BTR, "CD is now %d.\n", CD);
602 set_current_state (TASK_INTERRUPTIBLE);
603 if (tty_hung_up_p(filp) ||
604 !(port->flags & ASYNC_INITIALIZED)) {
605 if (port->flags & ASYNC_HUP_NOTIFY)
608 retval = -ERESTARTSYS;
611 if (!(port->flags & ASYNC_CLOSING) &&
614 gs_dprintk (GS_DEBUG_BTR, "signal_pending is now: %d (%lx)\n",
615 (int)signal_pending (current), *(long*)(¤t->blocked));
616 if (signal_pending(current)) {
617 retval = -ERESTARTSYS;
622 gs_dprintk (GS_DEBUG_BTR, "Got out of the loop. (%d)\n",
624 set_current_state (TASK_RUNNING);
625 remove_wait_queue(&port->open_wait, &wait);
626 if (!tty_hung_up_p(filp))
628 port->blocked_open--;
632 port->flags |= ASYNC_NORMAL_ACTIVE;
638 void gs_close(struct tty_struct * tty, struct file * filp)
641 struct gs_port *port;
647 port = (struct gs_port *) tty->driver_data;
652 /* This seems to happen when this is called from vhangup. */
653 gs_dprintk (GS_DEBUG_CLOSE, "gs: Odd: port->tty is NULL\n");
657 save_flags(flags); cli();
659 if (tty_hung_up_p(filp)) {
660 restore_flags(flags);
661 port->rd->hungup (port);
666 if ((tty->count == 1) && (port->count != 1)) {
667 printk(KERN_ERR "gs: gs_close: bad port count;"
668 " tty->count is 1, port count is %d\n", port->count);
671 if (--port->count < 0) {
672 printk(KERN_ERR "gs: gs_close: bad port count: %d\n", port->count);
676 gs_dprintk(GS_DEBUG_CLOSE, "gs_close: count: %d\n", port->count);
677 restore_flags(flags);
681 port->flags |= ASYNC_CLOSING;
684 * Now we wait for the transmit buffer to clear; and we notify
685 * the line discipline to only process XON/XOFF characters.
688 /* if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE)
689 tty_wait_until_sent(tty, port->closing_wait); */
692 * At this point we stop accepting input. To do this, we
693 * disable the receive line status interrupts, and tell the
694 * interrupt driver to stop checking the data ready bit in the
695 * line status register.
698 port->rd->disable_rx_interrupts (port);
700 /* close has no way of returning "EINTR", so discard return value */
701 if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE)
702 gs_wait_tx_flushed (port, port->closing_wait);
704 port->flags &= ~GS_ACTIVE;
706 if (tty->driver->flush_buffer)
707 tty->driver->flush_buffer(tty);
709 tty_ldisc_flush(tty);
713 port->rd->close (port);
714 port->rd->shutdown_port (port);
717 if (port->blocked_open) {
718 if (port->close_delay) {
719 msleep_interruptible(jiffies_to_msecs(port->close_delay));
721 wake_up_interruptible(&port->open_wait);
723 port->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING | ASYNC_INITIALIZED);
724 wake_up_interruptible(&port->close_wait);
726 restore_flags(flags);
731 static unsigned int gs_baudrates[] = {
732 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
733 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600
737 void gs_set_termios (struct tty_struct * tty,
738 struct termios * old_termios)
740 struct gs_port *port;
741 int baudrate, tmp, rv;
742 struct termios *tiosp;
748 port = tty->driver_data;
752 tiosp = tty->termios;
754 if (gs_debug & GS_DEBUG_TERMIOS) {
755 gs_dprintk (GS_DEBUG_TERMIOS, "termios structure (%p):\n", tiosp);
759 /* This is an optimization that is only allowed for dumb cards */
760 /* Smart cards require knowledge of iflags and oflags too: that
761 might change hardware cooking mode.... */
764 if( (tiosp->c_iflag == old_termios->c_iflag)
765 && (tiosp->c_oflag == old_termios->c_oflag)
766 && (tiosp->c_cflag == old_termios->c_cflag)
767 && (tiosp->c_lflag == old_termios->c_lflag)
768 && (tiosp->c_line == old_termios->c_line)
769 && (memcmp(tiosp->c_cc, old_termios->c_cc, NCC) == 0)) {
770 gs_dprintk(GS_DEBUG_TERMIOS, "gs_set_termios: optimized away\n");
774 gs_dprintk(GS_DEBUG_TERMIOS, "gs_set_termios: no old_termios: "
775 "no optimization\n");
777 if(old_termios && (gs_debug & GS_DEBUG_TERMIOS)) {
778 if(tiosp->c_iflag != old_termios->c_iflag) printk("c_iflag changed\n");
779 if(tiosp->c_oflag != old_termios->c_oflag) printk("c_oflag changed\n");
780 if(tiosp->c_cflag != old_termios->c_cflag) printk("c_cflag changed\n");
781 if(tiosp->c_lflag != old_termios->c_lflag) printk("c_lflag changed\n");
782 if(tiosp->c_line != old_termios->c_line) printk("c_line changed\n");
783 if(!memcmp(tiosp->c_cc, old_termios->c_cc, NCC)) printk("c_cc changed\n");
786 baudrate = tiosp->c_cflag & CBAUD;
787 if (baudrate & CBAUDEX) {
788 baudrate &= ~CBAUDEX;
789 if ((baudrate < 1) || (baudrate > 4))
790 tiosp->c_cflag &= ~CBAUDEX;
795 baudrate = gs_baudrates[baudrate];
796 if ((tiosp->c_cflag & CBAUD) == B38400) {
797 if ( (port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
799 else if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
801 else if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)
803 else if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
805 else if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)
806 baudrate = (port->baud_base / port->custom_divisor);
809 /* I recommend using THIS instead of the mess in termios (and
810 duplicating the above code). Next we should create a clean
811 interface towards this variable. If your card supports arbitrary
812 baud rates, (e.g. CD1400 or 16550 based cards) then everything
813 will be very easy..... */
814 port->baud = baudrate;
816 /* Two timer ticks seems enough to wakeup something like SLIP driver */
817 /* Baudrate/10 is cps. Divide by HZ to get chars per tick. */
818 tmp = (baudrate / 10 / HZ) * 2;
820 if (tmp < 0) tmp = 0;
821 if (tmp >= SERIAL_XMIT_SIZE) tmp = SERIAL_XMIT_SIZE-1;
823 port->wakeup_chars = tmp;
825 /* We should really wait for the characters to be all sent before
826 changing the settings. -- CAL */
827 rv = gs_wait_tx_flushed (port, MAX_SCHEDULE_TIMEOUT);
828 if (rv < 0) return /* rv */;
830 rv = port->rd->set_real_termios(port);
831 if (rv < 0) return /* rv */;
834 (old_termios->c_cflag & CRTSCTS)) &&
835 !( tiosp->c_cflag & CRTSCTS)) {
840 #ifdef tytso_patch_94Nov25_1726
841 /* This "makes sense", Why is it commented out? */
843 if (!(old_termios->c_cflag & CLOCAL) &&
844 (tty->termios->c_cflag & CLOCAL))
845 wake_up_interruptible(&info->open_wait);
854 /* Must be called with interrupts enabled */
855 int gs_init_port(struct gs_port *port)
862 page = get_zeroed_page(GFP_KERNEL);
864 cli (); /* Don't expect this to make a difference. */
868 tmp_buf = (unsigned char *) page;
869 restore_flags (flags);
876 if (port->flags & ASYNC_INITIALIZED)
879 if (!port->xmit_buf) {
880 /* We may sleep in get_zeroed_page() */
883 tmp = get_zeroed_page(GFP_KERNEL);
890 port->xmit_buf = (unsigned char *) tmp;
891 restore_flags (flags);
900 clear_bit(TTY_IO_ERROR, &port->tty->flags);
902 port->xmit_cnt = port->xmit_head = port->xmit_tail = 0;
904 gs_set_termios(port->tty, NULL);
906 port->flags |= ASYNC_INITIALIZED;
907 port->flags &= ~GS_TX_INTEN;
909 restore_flags(flags);
914 int gs_setserial(struct gs_port *port, struct serial_struct __user *sp)
916 struct serial_struct sio;
918 if (copy_from_user(&sio, sp, sizeof(struct serial_struct)))
921 if (!capable(CAP_SYS_ADMIN)) {
922 if ((sio.baud_base != port->baud_base) ||
923 (sio.close_delay != port->close_delay) ||
924 ((sio.flags & ~ASYNC_USR_MASK) !=
925 (port->flags & ~ASYNC_USR_MASK)))
929 port->flags = (port->flags & ~ASYNC_USR_MASK) |
930 (sio.flags & ASYNC_USR_MASK);
932 port->baud_base = sio.baud_base;
933 port->close_delay = sio.close_delay;
934 port->closing_wait = sio.closing_wait;
935 port->custom_divisor = sio.custom_divisor;
937 gs_set_termios (port->tty, NULL);
943 /*****************************************************************************/
946 * Generate the serial struct info.
949 int gs_getserial(struct gs_port *port, struct serial_struct __user *sp)
951 struct serial_struct sio;
953 memset(&sio, 0, sizeof(struct serial_struct));
954 sio.flags = port->flags;
955 sio.baud_base = port->baud_base;
956 sio.close_delay = port->close_delay;
957 sio.closing_wait = port->closing_wait;
958 sio.custom_divisor = port->custom_divisor;
961 /* If you want you can override these. */
962 sio.type = PORT_UNKNOWN;
963 sio.xmit_fifo_size = -1;
968 if (port->rd->getserial)
969 port->rd->getserial (port, &sio);
971 if (copy_to_user(sp, &sio, sizeof(struct serial_struct)))
978 void gs_got_break(struct gs_port *port)
980 if (port->flags & ASYNC_SAK) {
983 *(port->tty->flip.flag_buf_ptr) = TTY_BREAK;
984 port->tty->flip.flag_buf_ptr++;
985 port->tty->flip.char_buf_ptr++;
986 port->tty->flip.count++;
990 EXPORT_SYMBOL(gs_put_char);
991 EXPORT_SYMBOL(gs_write);
992 EXPORT_SYMBOL(gs_write_room);
993 EXPORT_SYMBOL(gs_chars_in_buffer);
994 EXPORT_SYMBOL(gs_flush_buffer);
995 EXPORT_SYMBOL(gs_flush_chars);
996 EXPORT_SYMBOL(gs_stop);
997 EXPORT_SYMBOL(gs_start);
998 EXPORT_SYMBOL(gs_hangup);
999 EXPORT_SYMBOL(gs_do_softint);
1000 EXPORT_SYMBOL(gs_block_til_ready);
1001 EXPORT_SYMBOL(gs_close);
1002 EXPORT_SYMBOL(gs_set_termios);
1003 EXPORT_SYMBOL(gs_init_port);
1004 EXPORT_SYMBOL(gs_setserial);
1005 EXPORT_SYMBOL(gs_getserial);
1006 EXPORT_SYMBOL(gs_got_break);
1008 MODULE_LICENSE("GPL");