X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Fchar%2Frocket.c;h=e249d8cfcd06ce68c283fabb11a13618764373ae;hb=8e39c933b1b7df501dbb68879fb1640e277b8a5c;hp=bac80056f7e0c7e45893c7f7a46f9b2c196222af;hpb=c730f5b621afa33e9f4939da9078669162ebff4e;p=linux-2.6-omap-h63xx.git diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index bac80056f7e..e249d8cfcd0 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c @@ -65,10 +65,6 @@ /****** Kernel includes ******/ -#ifdef MODVERSIONS -#include -#endif - #include #include #include @@ -106,6 +102,8 @@ /****** RocketPort Local Variables ******/ +static void rp_do_poll(unsigned long dummy); + static struct tty_driver *rocket_driver; static struct rocket_version driver_version = { @@ -116,7 +114,7 @@ static struct r_port *rp_table[MAX_RP_PORTS]; /* The main repository of static unsigned int xmit_flags[NUM_BOARDS]; /* Bit significant, indicates port had data to transmit. */ /* eg. Bit 0 indicates port 0 has xmit data, ... */ static atomic_t rp_num_ports_open; /* Number of serial ports open */ -static struct timer_list rocket_timer; +static DEFINE_TIMER(rocket_timer, rp_do_poll, 0, 0); static unsigned long board1; /* ISA addresses, retrieved from rocketport.conf */ static unsigned long board2; @@ -474,7 +472,6 @@ static void rp_do_transmit(struct r_port *info) if (info->xmit_cnt < WAKEUP_CHARS) { tty_wakeup(tty); - wake_up_interruptible(&tty->write_wait); #ifdef ROCKETPORT_HAVE_POLL_WAIT wake_up_interruptible(&tty->poll_wait); #endif @@ -712,7 +709,7 @@ static void init_r_port(int board, int aiop, int chan, struct pci_dev *pci_dev) * user mode into the driver (exception handler). *info CD manipulation is spinlock protected. */ static void configure_r_port(struct r_port *info, - struct termios *old_termios) + struct ktermios *old_termios) { unsigned cflag; unsigned long flags; @@ -946,7 +943,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, #endif schedule(); /* Don't hold spinlock here, will hang PC */ } - current->state = TASK_RUNNING; + __set_current_state(TASK_RUNNING); remove_wait_queue(&info->open_wait, &wait); spin_lock_irqsave(&info->slock, flags); @@ -1017,7 +1014,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp) /* * Info->count is now 1; so it's safe to sleep now. */ - info->session = current->signal->session; + info->session = process_session(current); info->pgrp = process_group(current); if ((info->flags & ROCKET_INITIALIZED) == 0) { @@ -1194,7 +1191,7 @@ static void rp_close(struct tty_struct *tty, struct file *filp) } static void rp_set_termios(struct tty_struct *tty, - struct termios *old_termios) + struct ktermios *old_termios) { struct r_port *info = (struct r_port *) tty->driver_data; CHANNEL_t *cp; @@ -1601,7 +1598,7 @@ static void rp_wait_until_sent(struct tty_struct *tty, int timeout) if (signal_pending(current)) break; } - current->state = TASK_RUNNING; + __set_current_state(TASK_RUNNING); #ifdef ROCKET_DEBUG_WAIT_UNTIL_SENT printk(KERN_INFO "txcnt = %d (jiff=%lu)...done\n", txcnt, jiffies); #endif @@ -1772,7 +1769,6 @@ static int rp_write(struct tty_struct *tty, end: if (info->xmit_cnt < WAKEUP_CHARS) { tty_wakeup(tty); - wake_up_interruptible(&tty->write_wait); #ifdef ROCKETPORT_HAVE_POLL_WAIT wake_up_interruptible(&tty->poll_wait); #endif @@ -1841,7 +1837,6 @@ static void rp_flush_buffer(struct tty_struct *tty) info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; spin_unlock_irqrestore(&info->slock, flags); - wake_up_interruptible(&tty->write_wait); #ifdef ROCKETPORT_HAVE_POLL_WAIT wake_up_interruptible(&tty->poll_wait); #endif @@ -1853,6 +1848,12 @@ static void rp_flush_buffer(struct tty_struct *tty) #ifdef CONFIG_PCI +static struct pci_device_id __devinitdata rocket_pci_ids[] = { + { PCI_DEVICE(PCI_VENDOR_ID_RP, PCI_ANY_ID) }, + { } +}; +MODULE_DEVICE_TABLE(pci, rocket_pci_ids); + /* * Called when a PCI card is found. Retrieves and stores model information, * init's aiopic and serial port hardware. @@ -2214,7 +2215,7 @@ static int __init init_PCI(int boards_found) int count = 0; /* Work through the PCI device list, pulling out ours */ - while ((dev = pci_find_device(PCI_VENDOR_ID_RP, PCI_ANY_ID, dev))) { + while ((dev = pci_get_device(PCI_VENDOR_ID_RP, PCI_ANY_ID, dev))) { if (register_PCI(count + boards_found, dev)) count++; } @@ -2370,12 +2371,6 @@ static int __init rp_init(void) if (!rocket_driver) return -ENOMEM; - /* - * Set up the timer channel. - */ - init_timer(&rocket_timer); - rocket_timer.function = rp_do_poll; - /* * Initialize the array of pointers to our own internal state * structures. @@ -2436,6 +2431,8 @@ static int __init rp_init(void) rocket_driver->init_termios = tty_std_termios; rocket_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; + rocket_driver->init_termios.c_ispeed = 9600; + rocket_driver->init_termios.c_ospeed = 9600; #ifdef ROCKET_SOFT_FLOW rocket_driver->flags |= TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV; #endif