--- source/pciport/pciport.v704.c 2006-06-23 04:39:21.000000000 -0700 +++ rayon.c 2009-05-19 14:09:55.769232835 -0700 @@ -38,7 +38,7 @@ #define RS_STROBE_TIME (10*HZ) #define RS_ISR_PASS_LIMIT 256 -#define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT) +#define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? IRQF_SHARED : IRQF_TIMER) #define SERIAL_INLINE static char *serial_version = "4.27"; @@ -55,7 +55,7 @@ * End of serial driver configuration section. */ -#include +//#include #include #include #include @@ -156,6 +156,9 @@ RAYON PCI-Serial Device Driver Ver:7.0.4\n\ Copyright (C) 2005-2012 Rayon Company, Ltd.\n\ All Rights Reserved\n\ +\n\ +Updated for Linux 2.6.26 by Roller Network LLC\n\ +66asuym.icu\n\ **********************************************"; @@ -2230,10 +2233,15 @@ } p220shutdown(info); + /* if (tty->driver->flush_buffer) tty->driver->flush_buffer(tty); + */ + if (tty->driver->ops->flush_buffer) + tty_driver_flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); + tty->closing = 0; info->event = 0; info->tty = 0; @@ -2491,7 +2499,8 @@ /*yuchiehu*/ info->xmit_fifo_size = sstate->xmit_fifo_size; info->line = line; - INIT_WORK(&info->work, p220_do_softint, info); + //INIT_WORK(&info->work, p220_do_softint, info); + INIT_WORK(&info->work, p220_do_softint); info->state = sstate; if (sstate->info) { @@ -2833,7 +2842,7 @@ cardstart=0; { - while ((pdev = pci_find_device(RAYON_VENDOR_ID1,RAYON_DEVICE_ID, pdev))) + while ((pdev = pci_get_device(RAYON_VENDOR_ID1,RAYON_DEVICE_ID, pdev))) { if (pci_enable_device(pdev)) continue; @@ -3154,7 +3163,7 @@ } // match if } // match while - while ((pdev = pci_find_device(RAYON_VENDOR_ID2,RAYON_DEVICE_ID, pdev))) + while ((pdev = pci_get_device(RAYON_VENDOR_ID2,RAYON_DEVICE_ID, pdev))) { if (pci_enable_device(pdev)) continue; @@ -3472,7 +3481,7 @@ raypcisum++; } // match if } // match while - while ((pdev = pci_find_device(RAYON_VENDOR_ID3,RAYON_DEVICE_ID2, pdev))) + while ((pdev = pci_get_device(RAYON_VENDOR_ID3,RAYON_DEVICE_ID2, pdev))) { if (pci_enable_device(pdev)) continue; @@ -3907,6 +3916,27 @@ * The serial driver boot-time initialization code! */ +static const struct tty_operations p220_ops = { + .open = p220_open, + .close = p220_close, + .write = p220_write, + .put_char = p220_put_char, + .flush_chars = p220_flush_chars, + .write_room = p220_write_room, + .chars_in_buffer = p220_chars_in_buffer, + .flush_buffer = p220_flush_buffer, + .ioctl = p220_ioctl, + .throttle = p220_throttle, + .unthrottle = p220_unthrottle, + .send_xchar = p220_send_xchar, + .set_termios = p220_set_termios, + .stop = p220_stop, + .start = p220_start, + .hangup = p220_hangup, + .break_ctl = p220_break, + .wait_until_sent = p220_wait_until_sent, + .read_proc = p220_read_proc, +}; /*__initfunc(int RPort_init(void)) */ @@ -3954,6 +3984,7 @@ if (!p220_serial_driver) return -ENOMEM; + /* Initialize the tty_driver structure */ p220_serial_driver->owner = THIS_MODULE; p220_serial_driver->magic = TTY_DRIVER_MAGIC; p220_serial_driver->driver_name = "pciport"; @@ -3974,11 +4005,14 @@ p220_serial_driver->init_termios = tty_std_termios; p220_serial_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; - p220_serial_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;/*2001/03/14 LoriHu*/ + p220_serial_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;/*2001/03/14 LoriHu*/ p220_serial_driver->refcount = p220_serial_refcount; p220_serial_driver->ttys = p220_serial_table; p220_serial_driver->termios = p220_serial_termios; p220_serial_driver->termios_locked = p220_serial_termios_locked; + + tty_set_operations(p220_serial_driver, &p220_ops); + /* p220_serial_driver->open = p220_open; p220_serial_driver->close = p220_close; p220_serial_driver->write = p220_write; @@ -3998,6 +4032,8 @@ p220_serial_driver->break_ctl = p220_break; p220_serial_driver->wait_until_sent = p220_wait_until_sent; p220_serial_driver->read_proc = p220_read_proc; + */ + if (tty_register_driver(p220_serial_driver)) panic("Couldn't register serial driver\n");