aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/pcmcia
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-01 15:26:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-01 15:26:52 -0400
commit3498d13b8090c0b0ef911409fbc503a7c4cca6ef (patch)
tree254ca00276e863d9fba25707690c66b2a04c49e9 /drivers/char/pcmcia
parentdef7cb8cd4e3258db88050eaaca5438bcc3dafca (diff)
parent0c57dfcc6c1d037243c2f8fbf62eab3633326ec0 (diff)
Merge tag 'tty-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull TTY changes from Greg Kroah-Hartman: "As we skipped the merge window for 3.6-rc1 for the tty tree, everything is now settled down and working properly, so we are ready for 3.7-rc1. Here's the patchset, it's big, but the large changes are removing a firmware file and adding a staging tty driver (it depended on the tty core changes, so it's going through this tree instead of the staging tree.) All of these patches have been in the linux-next tree for a while. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" Fix up more-or-less trivial conflicts in - drivers/char/pcmcia/synclink_cs.c: tty NULL dereference fix vs tty_port_cts_enabled() helper function - drivers/staging/{Kconfig,Makefile}: add-add conflict (dgrp driver added close to other staging drivers) - drivers/staging/ipack/devices/ipoctal.c: "split ipoctal_channel from iopctal" vs "TTY: use tty_port_register_device" * tag 'tty-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (235 commits) tty/serial: Add kgdb_nmi driver tty/serial/amba-pl011: Quiesce interrupts in poll_get_char tty/serial/amba-pl011: Implement poll_init callback tty/serial/core: Introduce poll_init callback kdb: Turn KGDB_KDB=n stubs into static inlines kdb: Implement disable_nmi command kernel/debug: Mask KGDB NMI upon entry serial: pl011: handle corruption at high clock speeds serial: sccnxp: Make 'default' choice in switch last serial: sccnxp: Remove mask termios caps for SW flow control serial: sccnxp: Report actual baudrate back to core serial: samsung: Add poll_get_char & poll_put_char Powerpc 8xx CPM_UART setting MAXIDL register proportionaly to baud rate Powerpc 8xx CPM_UART maxidl should not depend on fifo size Powerpc 8xx CPM_UART too many interrupts Powerpc 8xx CPM_UART desynchronisation serial: set correct baud_base for EXSYS EX-41092 Dual 16950 serial: omap: fix the reciever line error case 8250: blacklist Winbond CIR port 8250_pnp: do pnp probe before legacy probe ...
Diffstat (limited to 'drivers/char/pcmcia')
-rw-r--r--drivers/char/pcmcia/synclink_cs.c131
1 files changed, 60 insertions, 71 deletions
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index a6b8ddea2227..21721d25e388 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -1058,7 +1058,7 @@ static void cts_change(MGSLPC_INFO *info, struct tty_struct *tty)
1058 wake_up_interruptible(&info->status_event_wait_q); 1058 wake_up_interruptible(&info->status_event_wait_q);
1059 wake_up_interruptible(&info->event_wait_q); 1059 wake_up_interruptible(&info->event_wait_q);
1060 1060
1061 if (tty && (info->port.flags & ASYNC_CTS_FLOW)) { 1061 if (tty && tty_port_cts_enabled(&info->port)) {
1062 if (tty->hw_stopped) { 1062 if (tty->hw_stopped) {
1063 if (info->serial_signals & SerialSignal_CTS) { 1063 if (info->serial_signals & SerialSignal_CTS) {
1064 if (debug_level >= DEBUG_LEVEL_ISR) 1064 if (debug_level >= DEBUG_LEVEL_ISR)
@@ -1350,7 +1350,7 @@ static void shutdown(MGSLPC_INFO * info, struct tty_struct *tty)
1350 /* TODO:disable interrupts instead of reset to preserve signal states */ 1350 /* TODO:disable interrupts instead of reset to preserve signal states */
1351 reset_device(info); 1351 reset_device(info);
1352 1352
1353 if (!tty || tty->termios->c_cflag & HUPCL) { 1353 if (!tty || tty->termios.c_cflag & HUPCL) {
1354 info->serial_signals &= ~(SerialSignal_DTR + SerialSignal_RTS); 1354 info->serial_signals &= ~(SerialSignal_DTR + SerialSignal_RTS);
1355 set_signals(info); 1355 set_signals(info);
1356 } 1356 }
@@ -1391,7 +1391,7 @@ static void mgslpc_program_hw(MGSLPC_INFO *info, struct tty_struct *tty)
1391 port_irq_enable(info, (unsigned char) PVR_DSR | PVR_RI); 1391 port_irq_enable(info, (unsigned char) PVR_DSR | PVR_RI);
1392 get_signals(info); 1392 get_signals(info);
1393 1393
1394 if (info->netcount || (tty && (tty->termios->c_cflag & CREAD))) 1394 if (info->netcount || (tty && (tty->termios.c_cflag & CREAD)))
1395 rx_start(info); 1395 rx_start(info);
1396 1396
1397 spin_unlock_irqrestore(&info->lock,flags); 1397 spin_unlock_irqrestore(&info->lock,flags);
@@ -1404,14 +1404,14 @@ static void mgslpc_change_params(MGSLPC_INFO *info, struct tty_struct *tty)
1404 unsigned cflag; 1404 unsigned cflag;
1405 int bits_per_char; 1405 int bits_per_char;
1406 1406
1407 if (!tty || !tty->termios) 1407 if (!tty)
1408 return; 1408 return;
1409 1409
1410 if (debug_level >= DEBUG_LEVEL_INFO) 1410 if (debug_level >= DEBUG_LEVEL_INFO)
1411 printk("%s(%d):mgslpc_change_params(%s)\n", 1411 printk("%s(%d):mgslpc_change_params(%s)\n",
1412 __FILE__,__LINE__, info->device_name ); 1412 __FILE__,__LINE__, info->device_name );
1413 1413
1414 cflag = tty->termios->c_cflag; 1414 cflag = tty->termios.c_cflag;
1415 1415
1416 /* if B0 rate (hangup) specified then negate DTR and RTS */ 1416 /* if B0 rate (hangup) specified then negate DTR and RTS */
1417 /* otherwise assert DTR and RTS */ 1417 /* otherwise assert DTR and RTS */
@@ -1734,7 +1734,7 @@ static void mgslpc_throttle(struct tty_struct * tty)
1734 if (I_IXOFF(tty)) 1734 if (I_IXOFF(tty))
1735 mgslpc_send_xchar(tty, STOP_CHAR(tty)); 1735 mgslpc_send_xchar(tty, STOP_CHAR(tty));
1736 1736
1737 if (tty->termios->c_cflag & CRTSCTS) { 1737 if (tty->termios.c_cflag & CRTSCTS) {
1738 spin_lock_irqsave(&info->lock,flags); 1738 spin_lock_irqsave(&info->lock,flags);
1739 info->serial_signals &= ~SerialSignal_RTS; 1739 info->serial_signals &= ~SerialSignal_RTS;
1740 set_signals(info); 1740 set_signals(info);
@@ -1763,7 +1763,7 @@ static void mgslpc_unthrottle(struct tty_struct * tty)
1763 mgslpc_send_xchar(tty, START_CHAR(tty)); 1763 mgslpc_send_xchar(tty, START_CHAR(tty));
1764 } 1764 }
1765 1765
1766 if (tty->termios->c_cflag & CRTSCTS) { 1766 if (tty->termios.c_cflag & CRTSCTS) {
1767 spin_lock_irqsave(&info->lock,flags); 1767 spin_lock_irqsave(&info->lock,flags);
1768 info->serial_signals |= SerialSignal_RTS; 1768 info->serial_signals |= SerialSignal_RTS;
1769 set_signals(info); 1769 set_signals(info);
@@ -2299,8 +2299,8 @@ static void mgslpc_set_termios(struct tty_struct *tty, struct ktermios *old_term
2299 tty->driver->name ); 2299 tty->driver->name );
2300 2300
2301 /* just return if nothing has changed */ 2301 /* just return if nothing has changed */
2302 if ((tty->termios->c_cflag == old_termios->c_cflag) 2302 if ((tty->termios.c_cflag == old_termios->c_cflag)
2303 && (RELEVANT_IFLAG(tty->termios->c_iflag) 2303 && (RELEVANT_IFLAG(tty->termios.c_iflag)
2304 == RELEVANT_IFLAG(old_termios->c_iflag))) 2304 == RELEVANT_IFLAG(old_termios->c_iflag)))
2305 return; 2305 return;
2306 2306
@@ -2308,7 +2308,7 @@ static void mgslpc_set_termios(struct tty_struct *tty, struct ktermios *old_term
2308 2308
2309 /* Handle transition to B0 status */ 2309 /* Handle transition to B0 status */
2310 if (old_termios->c_cflag & CBAUD && 2310 if (old_termios->c_cflag & CBAUD &&
2311 !(tty->termios->c_cflag & CBAUD)) { 2311 !(tty->termios.c_cflag & CBAUD)) {
2312 info->serial_signals &= ~(SerialSignal_RTS + SerialSignal_DTR); 2312 info->serial_signals &= ~(SerialSignal_RTS + SerialSignal_DTR);
2313 spin_lock_irqsave(&info->lock,flags); 2313 spin_lock_irqsave(&info->lock,flags);
2314 set_signals(info); 2314 set_signals(info);
@@ -2317,9 +2317,9 @@ static void mgslpc_set_termios(struct tty_struct *tty, struct ktermios *old_term
2317 2317
2318 /* Handle transition away from B0 status */ 2318 /* Handle transition away from B0 status */
2319 if (!(old_termios->c_cflag & CBAUD) && 2319 if (!(old_termios->c_cflag & CBAUD) &&
2320 tty->termios->c_cflag & CBAUD) { 2320 tty->termios.c_cflag & CBAUD) {
2321 info->serial_signals |= SerialSignal_DTR; 2321 info->serial_signals |= SerialSignal_DTR;
2322 if (!(tty->termios->c_cflag & CRTSCTS) || 2322 if (!(tty->termios.c_cflag & CRTSCTS) ||
2323 !test_bit(TTY_THROTTLED, &tty->flags)) { 2323 !test_bit(TTY_THROTTLED, &tty->flags)) {
2324 info->serial_signals |= SerialSignal_RTS; 2324 info->serial_signals |= SerialSignal_RTS;
2325 } 2325 }
@@ -2330,7 +2330,7 @@ static void mgslpc_set_termios(struct tty_struct *tty, struct ktermios *old_term
2330 2330
2331 /* Handle turning off CRTSCTS */ 2331 /* Handle turning off CRTSCTS */
2332 if (old_termios->c_cflag & CRTSCTS && 2332 if (old_termios->c_cflag & CRTSCTS &&
2333 !(tty->termios->c_cflag & CRTSCTS)) { 2333 !(tty->termios.c_cflag & CRTSCTS)) {
2334 tty->hw_stopped = 0; 2334 tty->hw_stopped = 0;
2335 tx_release(tty); 2335 tx_release(tty);
2336 } 2336 }
@@ -2737,6 +2737,8 @@ static void mgslpc_add_device(MGSLPC_INFO *info)
2737#if SYNCLINK_GENERIC_HDLC 2737#if SYNCLINK_GENERIC_HDLC
2738 hdlcdev_init(info); 2738 hdlcdev_init(info);
2739#endif 2739#endif
2740 tty_port_register_device(&info->port, serial_driver, info->line,
2741 &info->p_dev->dev);
2740} 2742}
2741 2743
2742static void mgslpc_remove_device(MGSLPC_INFO *remove_info) 2744static void mgslpc_remove_device(MGSLPC_INFO *remove_info)
@@ -2750,6 +2752,7 @@ static void mgslpc_remove_device(MGSLPC_INFO *remove_info)
2750 last->next_device = info->next_device; 2752 last->next_device = info->next_device;
2751 else 2753 else
2752 mgslpc_device_list = info->next_device; 2754 mgslpc_device_list = info->next_device;
2755 tty_unregister_device(serial_driver, info->line);
2753#if SYNCLINK_GENERIC_HDLC 2756#if SYNCLINK_GENERIC_HDLC
2754 hdlcdev_exit(info); 2757 hdlcdev_exit(info);
2755#endif 2758#endif
@@ -2804,77 +2807,63 @@ static const struct tty_operations mgslpc_ops = {
2804 .proc_fops = &mgslpc_proc_fops, 2807 .proc_fops = &mgslpc_proc_fops,
2805}; 2808};
2806 2809
2807static void synclink_cs_cleanup(void) 2810static int __init synclink_cs_init(void)
2808{ 2811{
2809 int rc; 2812 int rc;
2810 2813
2811 while(mgslpc_device_list) 2814 if (break_on_load) {
2812 mgslpc_remove_device(mgslpc_device_list); 2815 mgslpc_get_text_ptr();
2813 2816 BREAKPOINT();
2814 if (serial_driver) {
2815 if ((rc = tty_unregister_driver(serial_driver)))
2816 printk("%s(%d) failed to unregister tty driver err=%d\n",
2817 __FILE__,__LINE__,rc);
2818 put_tty_driver(serial_driver);
2819 } 2817 }
2820 2818
2821 pcmcia_unregister_driver(&mgslpc_driver); 2819 serial_driver = tty_alloc_driver(MAX_DEVICE_COUNT,
2822} 2820 TTY_DRIVER_REAL_RAW |
2823 2821 TTY_DRIVER_DYNAMIC_DEV);
2824static int __init synclink_cs_init(void) 2822 if (IS_ERR(serial_driver)) {
2825{ 2823 rc = PTR_ERR(serial_driver);
2826 int rc; 2824 goto err;
2827 2825 }
2828 if (break_on_load) {
2829 mgslpc_get_text_ptr();
2830 BREAKPOINT();
2831 }
2832
2833 if ((rc = pcmcia_register_driver(&mgslpc_driver)) < 0)
2834 return rc;
2835
2836 serial_driver = alloc_tty_driver(MAX_DEVICE_COUNT);
2837 if (!serial_driver) {
2838 rc = -ENOMEM;
2839 goto error;
2840 }
2841 2826
2842 /* Initialize the tty_driver structure */ 2827 /* Initialize the tty_driver structure */
2843 2828 serial_driver->driver_name = "synclink_cs";
2844 serial_driver->driver_name = "synclink_cs"; 2829 serial_driver->name = "ttySLP";
2845 serial_driver->name = "ttySLP"; 2830 serial_driver->major = ttymajor;
2846 serial_driver->major = ttymajor; 2831 serial_driver->minor_start = 64;
2847 serial_driver->minor_start = 64; 2832 serial_driver->type = TTY_DRIVER_TYPE_SERIAL;
2848 serial_driver->type = TTY_DRIVER_TYPE_SERIAL; 2833 serial_driver->subtype = SERIAL_TYPE_NORMAL;
2849 serial_driver->subtype = SERIAL_TYPE_NORMAL; 2834 serial_driver->init_termios = tty_std_termios;
2850 serial_driver->init_termios = tty_std_termios; 2835 serial_driver->init_termios.c_cflag =
2851 serial_driver->init_termios.c_cflag = 2836 B9600 | CS8 | CREAD | HUPCL | CLOCAL;
2852 B9600 | CS8 | CREAD | HUPCL | CLOCAL; 2837 tty_set_operations(serial_driver, &mgslpc_ops);
2853 serial_driver->flags = TTY_DRIVER_REAL_RAW; 2838
2854 tty_set_operations(serial_driver, &mgslpc_ops); 2839 rc = tty_register_driver(serial_driver);
2855 2840 if (rc < 0) {
2856 if ((rc = tty_register_driver(serial_driver)) < 0) { 2841 printk(KERN_ERR "%s(%d):Couldn't register serial driver\n",
2857 printk("%s(%d):Couldn't register serial driver\n", 2842 __FILE__, __LINE__);
2858 __FILE__,__LINE__); 2843 goto err_put_tty;
2859 put_tty_driver(serial_driver); 2844 }
2860 serial_driver = NULL;
2861 goto error;
2862 }
2863 2845
2864 printk("%s %s, tty major#%d\n", 2846 rc = pcmcia_register_driver(&mgslpc_driver);
2865 driver_name, driver_version, 2847 if (rc < 0)
2866 serial_driver->major); 2848 goto err_unreg_tty;
2867 2849
2868 return 0; 2850 printk(KERN_INFO "%s %s, tty major#%d\n", driver_name, driver_version,
2851 serial_driver->major);
2869 2852
2870error: 2853 return 0;
2871 synclink_cs_cleanup(); 2854err_unreg_tty:
2872 return rc; 2855 tty_unregister_driver(serial_driver);
2856err_put_tty:
2857 put_tty_driver(serial_driver);
2858err:
2859 return rc;
2873} 2860}
2874 2861
2875static void __exit synclink_cs_exit(void) 2862static void __exit synclink_cs_exit(void)
2876{ 2863{
2877 synclink_cs_cleanup(); 2864 pcmcia_unregister_driver(&mgslpc_driver);
2865 tty_unregister_driver(serial_driver);
2866 put_tty_driver(serial_driver);
2878} 2867}
2879 2868
2880module_init(synclink_cs_init); 2869module_init(synclink_cs_init);