diff options
Diffstat (limited to 'drivers/char/mxser.c')
-rw-r--r-- | drivers/char/mxser.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index 5ed2486b7581..c063359baf78 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c | |||
@@ -328,8 +328,8 @@ struct mxser_struct { | |||
328 | int xmit_tail; | 328 | int xmit_tail; |
329 | int xmit_cnt; | 329 | int xmit_cnt; |
330 | struct work_struct tqueue; | 330 | struct work_struct tqueue; |
331 | struct termios normal_termios; | 331 | struct ktermios normal_termios; |
332 | struct termios callout_termios; | 332 | struct ktermios callout_termios; |
333 | wait_queue_head_t open_wait; | 333 | wait_queue_head_t open_wait; |
334 | wait_queue_head_t close_wait; | 334 | wait_queue_head_t close_wait; |
335 | wait_queue_head_t delta_msr_wait; | 335 | wait_queue_head_t delta_msr_wait; |
@@ -364,8 +364,8 @@ static int mxserBoardCAP[MXSER_BOARDS] = { | |||
364 | static struct tty_driver *mxvar_sdriver; | 364 | static struct tty_driver *mxvar_sdriver; |
365 | static struct mxser_struct mxvar_table[MXSER_PORTS]; | 365 | static struct mxser_struct mxvar_table[MXSER_PORTS]; |
366 | static struct tty_struct *mxvar_tty[MXSER_PORTS + 1]; | 366 | static struct tty_struct *mxvar_tty[MXSER_PORTS + 1]; |
367 | static struct termios *mxvar_termios[MXSER_PORTS + 1]; | 367 | static struct ktermios *mxvar_termios[MXSER_PORTS + 1]; |
368 | static struct termios *mxvar_termios_locked[MXSER_PORTS + 1]; | 368 | static struct ktermios *mxvar_termios_locked[MXSER_PORTS + 1]; |
369 | static struct mxser_log mxvar_log; | 369 | static struct mxser_log mxvar_log; |
370 | static int mxvar_diagflag; | 370 | static int mxvar_diagflag; |
371 | static unsigned char mxser_msr[MXSER_PORTS + 1]; | 371 | static unsigned char mxser_msr[MXSER_PORTS + 1]; |
@@ -402,7 +402,7 @@ static int mxser_ioctl(struct tty_struct *, struct file *, uint, ulong); | |||
402 | static int mxser_ioctl_special(unsigned int, void __user *); | 402 | static int mxser_ioctl_special(unsigned int, void __user *); |
403 | static void mxser_throttle(struct tty_struct *); | 403 | static void mxser_throttle(struct tty_struct *); |
404 | static void mxser_unthrottle(struct tty_struct *); | 404 | static void mxser_unthrottle(struct tty_struct *); |
405 | static void mxser_set_termios(struct tty_struct *, struct termios *); | 405 | static void mxser_set_termios(struct tty_struct *, struct ktermios *); |
406 | static void mxser_stop(struct tty_struct *); | 406 | static void mxser_stop(struct tty_struct *); |
407 | static void mxser_start(struct tty_struct *); | 407 | static void mxser_start(struct tty_struct *); |
408 | static void mxser_hangup(struct tty_struct *); | 408 | static void mxser_hangup(struct tty_struct *); |
@@ -414,7 +414,7 @@ static void mxser_check_modem_status(struct mxser_struct *, int); | |||
414 | static int mxser_block_til_ready(struct tty_struct *, struct file *, struct mxser_struct *); | 414 | static int mxser_block_til_ready(struct tty_struct *, struct file *, struct mxser_struct *); |
415 | static int mxser_startup(struct mxser_struct *); | 415 | static int mxser_startup(struct mxser_struct *); |
416 | static void mxser_shutdown(struct mxser_struct *); | 416 | static void mxser_shutdown(struct mxser_struct *); |
417 | static int mxser_change_speed(struct mxser_struct *, struct termios *old_termios); | 417 | static int mxser_change_speed(struct mxser_struct *, struct ktermios *old_termios); |
418 | static int mxser_get_serial_info(struct mxser_struct *, struct serial_struct __user *); | 418 | static int mxser_get_serial_info(struct mxser_struct *, struct serial_struct __user *); |
419 | static int mxser_set_serial_info(struct mxser_struct *, struct serial_struct __user *); | 419 | static int mxser_set_serial_info(struct mxser_struct *, struct serial_struct __user *); |
420 | static int mxser_get_lsr_info(struct mxser_struct *, unsigned int __user *); | 420 | static int mxser_get_lsr_info(struct mxser_struct *, unsigned int __user *); |
@@ -515,6 +515,7 @@ static void __exit mxser_module_exit(void) | |||
515 | if (pdev != NULL) { /* PCI */ | 515 | if (pdev != NULL) { /* PCI */ |
516 | release_region(pci_resource_start(pdev, 2), pci_resource_len(pdev, 2)); | 516 | release_region(pci_resource_start(pdev, 2), pci_resource_len(pdev, 2)); |
517 | release_region(pci_resource_start(pdev, 3), pci_resource_len(pdev, 3)); | 517 | release_region(pci_resource_start(pdev, 3), pci_resource_len(pdev, 3)); |
518 | pci_dev_put(pdev); | ||
518 | } else { | 519 | } else { |
519 | release_region(mxsercfg[i].ioaddr[0], 8 * mxsercfg[i].ports); | 520 | release_region(mxsercfg[i].ioaddr[0], 8 * mxsercfg[i].ports); |
520 | release_region(mxsercfg[i].vector, 1); | 521 | release_region(mxsercfg[i].vector, 1); |
@@ -556,7 +557,7 @@ static int mxser_initbrd(int board, struct mxser_hwconf *hwconf) | |||
556 | n = board * MXSER_PORTS_PER_BOARD; | 557 | n = board * MXSER_PORTS_PER_BOARD; |
557 | info = &mxvar_table[n]; | 558 | info = &mxvar_table[n]; |
558 | /*if (verbose) */ { | 559 | /*if (verbose) */ { |
559 | printk(KERN_DEBUG " ttyM%d - ttyM%d ", | 560 | printk(KERN_DEBUG " ttyMI%d - ttyMI%d ", |
560 | n, n + hwconf->ports - 1); | 561 | n, n + hwconf->ports - 1); |
561 | printk(" max. baud rate = %d bps.\n", | 562 | printk(" max. baud rate = %d bps.\n", |
562 | hwconf->MaxCanSetBaudRate[0]); | 563 | hwconf->MaxCanSetBaudRate[0]); |
@@ -717,7 +718,7 @@ static int mxser_init(void) | |||
717 | /* Initialize the tty_driver structure */ | 718 | /* Initialize the tty_driver structure */ |
718 | memset(mxvar_sdriver, 0, sizeof(struct tty_driver)); | 719 | memset(mxvar_sdriver, 0, sizeof(struct tty_driver)); |
719 | mxvar_sdriver->magic = TTY_DRIVER_MAGIC; | 720 | mxvar_sdriver->magic = TTY_DRIVER_MAGIC; |
720 | mxvar_sdriver->name = "ttyM"; | 721 | mxvar_sdriver->name = "ttyMI"; |
721 | mxvar_sdriver->major = ttymajor; | 722 | mxvar_sdriver->major = ttymajor; |
722 | mxvar_sdriver->minor_start = 0; | 723 | mxvar_sdriver->minor_start = 0; |
723 | mxvar_sdriver->num = MXSER_PORTS + 1; | 724 | mxvar_sdriver->num = MXSER_PORTS + 1; |
@@ -725,6 +726,8 @@ static int mxser_init(void) | |||
725 | mxvar_sdriver->subtype = SERIAL_TYPE_NORMAL; | 726 | mxvar_sdriver->subtype = SERIAL_TYPE_NORMAL; |
726 | mxvar_sdriver->init_termios = tty_std_termios; | 727 | mxvar_sdriver->init_termios = tty_std_termios; |
727 | mxvar_sdriver->init_termios.c_cflag = B9600|CS8|CREAD|HUPCL|CLOCAL; | 728 | mxvar_sdriver->init_termios.c_cflag = B9600|CS8|CREAD|HUPCL|CLOCAL; |
729 | mxvar_sdriver->init_termios.c_ispeed = 9600; | ||
730 | mxvar_sdriver->init_termios.c_ospeed = 9600; | ||
728 | mxvar_sdriver->flags = TTY_DRIVER_REAL_RAW; | 731 | mxvar_sdriver->flags = TTY_DRIVER_REAL_RAW; |
729 | tty_set_operations(mxvar_sdriver, &mxser_ops); | 732 | tty_set_operations(mxvar_sdriver, &mxser_ops); |
730 | mxvar_sdriver->ttys = mxvar_tty; | 733 | mxvar_sdriver->ttys = mxvar_tty; |
@@ -839,9 +842,9 @@ static int mxser_init(void) | |||
839 | index = 0; | 842 | index = 0; |
840 | b = 0; | 843 | b = 0; |
841 | while (b < n) { | 844 | while (b < n) { |
842 | pdev = pci_find_device(mxser_pcibrds[b].vendor, | 845 | pdev = pci_get_device(mxser_pcibrds[b].vendor, |
843 | mxser_pcibrds[b].device, pdev); | 846 | mxser_pcibrds[b].device, pdev); |
844 | if (pdev == NULL) { | 847 | if (pdev == NULL) { |
845 | b++; | 848 | b++; |
846 | continue; | 849 | continue; |
847 | } | 850 | } |
@@ -893,6 +896,9 @@ static int mxser_init(void) | |||
893 | if (mxser_initbrd(m, &hwconf) < 0) | 896 | if (mxser_initbrd(m, &hwconf) < 0) |
894 | continue; | 897 | continue; |
895 | m++; | 898 | m++; |
899 | /* Keep an extra reference if we succeeded. It will | ||
900 | be returned at unload time */ | ||
901 | pci_dev_get(pdev); | ||
896 | } | 902 | } |
897 | } | 903 | } |
898 | #endif | 904 | #endif |
@@ -994,7 +1000,7 @@ static int mxser_open(struct tty_struct *tty, struct file *filp) | |||
994 | mxser_change_speed(info, NULL); | 1000 | mxser_change_speed(info, NULL); |
995 | } | 1001 | } |
996 | 1002 | ||
997 | info->session = current->signal->session; | 1003 | info->session = process_session(current); |
998 | info->pgrp = process_group(current); | 1004 | info->pgrp = process_group(current); |
999 | 1005 | ||
1000 | /* | 1006 | /* |
@@ -1745,7 +1751,7 @@ static void mxser_unthrottle(struct tty_struct *tty) | |||
1745 | /* MX_UNLOCK(&info->slock); */ | 1751 | /* MX_UNLOCK(&info->slock); */ |
1746 | } | 1752 | } |
1747 | 1753 | ||
1748 | static void mxser_set_termios(struct tty_struct *tty, struct termios *old_termios) | 1754 | static void mxser_set_termios(struct tty_struct *tty, struct ktermios *old_termios) |
1749 | { | 1755 | { |
1750 | struct mxser_struct *info = tty->driver_data; | 1756 | struct mxser_struct *info = tty->driver_data; |
1751 | unsigned long flags; | 1757 | unsigned long flags; |
@@ -2537,7 +2543,7 @@ static void mxser_shutdown(struct mxser_struct *info) | |||
2537 | * This routine is called to set the UART divisor registers to match | 2543 | * This routine is called to set the UART divisor registers to match |
2538 | * the specified baud rate for a serial port. | 2544 | * the specified baud rate for a serial port. |
2539 | */ | 2545 | */ |
2540 | static int mxser_change_speed(struct mxser_struct *info, struct termios *old_termios) | 2546 | static int mxser_change_speed(struct mxser_struct *info, struct ktermios *old_termios) |
2541 | { | 2547 | { |
2542 | unsigned cflag, cval, fcr; | 2548 | unsigned cflag, cval, fcr; |
2543 | int ret = 0; | 2549 | int ret = 0; |