aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 16:41:04 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 16:41:04 -0500
commit21eaab6d19ed43e82ed39c8deb7f192134fb4a0e (patch)
treed995205afdcb7f47462bcd28067dc0c4ab0b7b02 /drivers/char
parent74e1a2a39355b2d3ae8c60c78d8add162c6d7183 (diff)
parent9e17df37d710f8998e9cb10a548304fe33d4a5c2 (diff)
Merge tag 'tty-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial patches from Greg Kroah-Hartman: "Here's the big tty/serial driver patches for 3.9-rc1. More tty port rework and fixes from Jiri here, as well as lots of individual serial driver updates and fixes. All of these have been in the linux-next tree for a while." * tag 'tty-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (140 commits) tty: mxser: improve error handling in mxser_probe() and mxser_module_init() serial: imx: fix uninitialized variable warning serial: tegra: assume CONFIG_OF TTY: do not update atime/mtime on read/write lguest: select CONFIG_TTY to build properly. ARM defconfigs: add missing inclusions of linux/platform_device.h fb/exynos: include platform_device.h ARM: sa1100/assabet: include platform_device.h directly serial: imx: Fix recursive locking bug pps: Fix build breakage from decoupling pps from tty tty: Remove ancient hardpps() pps: Additional cleanups in uart_handle_dcd_change pps: Move timestamp read into PPS code proper pps: Don't crash the machine when exiting will do pps: Fix a use-after free bug when unregistering a source. pps: Use pps_lookup_dev to reduce ldisc coupling pps: Add pps_lookup_dev() function tty: serial: uartlite: Support uartlite on big and little endian systems tty: serial: uartlite: Fix sparse and checkpatch warnings serial/arc-uart: Miscll DT related updates (Grant's review comments) ... Fix up trivial conflicts, mostly just due to the TTY config option clashing with the EXPERIMENTAL removal.
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/Kconfig7
-rw-r--r--drivers/char/pcmcia/Kconfig4
-rw-r--r--drivers/char/pcmcia/synclink_cs.c62
3 files changed, 37 insertions, 36 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 72bedad6bf8c..3bb6fa3930be 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -53,7 +53,7 @@ source "drivers/tty/serial/Kconfig"
53 53
54config TTY_PRINTK 54config TTY_PRINTK
55 bool "TTY driver to output user messages via printk" 55 bool "TTY driver to output user messages via printk"
56 depends on EXPERT 56 depends on EXPERT && TTY
57 default n 57 default n
58 ---help--- 58 ---help---
59 If you say Y here, the support for writing user messages (i.e. 59 If you say Y here, the support for writing user messages (i.e.
@@ -159,7 +159,7 @@ source "drivers/tty/hvc/Kconfig"
159 159
160config VIRTIO_CONSOLE 160config VIRTIO_CONSOLE
161 tristate "Virtio console" 161 tristate "Virtio console"
162 depends on VIRTIO 162 depends on VIRTIO && TTY
163 select HVC_DRIVER 163 select HVC_DRIVER
164 help 164 help
165 Virtio console for use with lguest and other hypervisors. 165 Virtio console for use with lguest and other hypervisors.
@@ -392,6 +392,7 @@ config XILINX_HWICAP
392 392
393config R3964 393config R3964
394 tristate "Siemens R3964 line discipline" 394 tristate "Siemens R3964 line discipline"
395 depends on TTY
395 ---help--- 396 ---help---
396 This driver allows synchronous communication with devices using the 397 This driver allows synchronous communication with devices using the
397 Siemens R3964 packet protocol. Unless you are dealing with special 398 Siemens R3964 packet protocol. Unless you are dealing with special
@@ -439,7 +440,7 @@ source "drivers/char/pcmcia/Kconfig"
439 440
440config MWAVE 441config MWAVE
441 tristate "ACP Modem (Mwave) support" 442 tristate "ACP Modem (Mwave) support"
442 depends on X86 443 depends on X86 && TTY
443 select SERIAL_8250 444 select SERIAL_8250
444 ---help--- 445 ---help---
445 The ACP modem (Mwave) for Linux is a WinModem. It is composed of a 446 The ACP modem (Mwave) for Linux is a WinModem. It is composed of a
diff --git a/drivers/char/pcmcia/Kconfig b/drivers/char/pcmcia/Kconfig
index 6614416a8623..2a166d56738a 100644
--- a/drivers/char/pcmcia/Kconfig
+++ b/drivers/char/pcmcia/Kconfig
@@ -7,7 +7,7 @@ menu "PCMCIA character devices"
7 7
8config SYNCLINK_CS 8config SYNCLINK_CS
9 tristate "SyncLink PC Card support" 9 tristate "SyncLink PC Card support"
10 depends on PCMCIA 10 depends on PCMCIA && TTY
11 help 11 help
12 Enable support for the SyncLink PC Card serial adapter, running 12 Enable support for the SyncLink PC Card serial adapter, running
13 asynchronous and HDLC communications up to 512Kbps. The port is 13 asynchronous and HDLC communications up to 512Kbps. The port is
@@ -45,7 +45,7 @@ config CARDMAN_4040
45 45
46config IPWIRELESS 46config IPWIRELESS
47 tristate "IPWireless 3G UMTS PCMCIA card support" 47 tristate "IPWireless 3G UMTS PCMCIA card support"
48 depends on PCMCIA && NETDEVICES 48 depends on PCMCIA && NETDEVICES && TTY
49 select PPP 49 select PPP
50 help 50 help
51 This is a driver for 3G UMTS PCMCIA card from IPWireless company. In 51 This is a driver for 3G UMTS PCMCIA card from IPWireless company. In
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index b66eaa04f8cb..d0c9852ab875 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -210,7 +210,7 @@ typedef struct _mgslpc_info {
210 char testing_irq; 210 char testing_irq;
211 unsigned int init_error; /* startup error (DIAGS) */ 211 unsigned int init_error; /* startup error (DIAGS) */
212 212
213 char flag_buf[MAX_ASYNC_BUFFER_SIZE]; 213 char *flag_buf;
214 bool drop_rts_on_tx_done; 214 bool drop_rts_on_tx_done;
215 215
216 struct _input_signal_events input_signal_events; 216 struct _input_signal_events input_signal_events;
@@ -765,9 +765,6 @@ static void bh_handler(struct work_struct *work)
765 struct tty_struct *tty; 765 struct tty_struct *tty;
766 int action; 766 int action;
767 767
768 if (!info)
769 return;
770
771 if (debug_level >= DEBUG_LEVEL_BH) 768 if (debug_level >= DEBUG_LEVEL_BH)
772 printk( "%s(%d):bh_handler(%s) entry\n", 769 printk( "%s(%d):bh_handler(%s) entry\n",
773 __FILE__,__LINE__,info->device_name); 770 __FILE__,__LINE__,info->device_name);
@@ -886,21 +883,14 @@ static void rx_ready_hdlc(MGSLPC_INFO *info, int eom)
886 issue_command(info, CHA, CMD_RXFIFO); 883 issue_command(info, CHA, CMD_RXFIFO);
887} 884}
888 885
889static void rx_ready_async(MGSLPC_INFO *info, int tcd, struct tty_struct *tty) 886static void rx_ready_async(MGSLPC_INFO *info, int tcd)
890{ 887{
888 struct tty_port *port = &info->port;
891 unsigned char data, status, flag; 889 unsigned char data, status, flag;
892 int fifo_count; 890 int fifo_count;
893 int work = 0; 891 int work = 0;
894 struct mgsl_icount *icount = &info->icount; 892 struct mgsl_icount *icount = &info->icount;
895 893
896 if (!tty) {
897 /* tty is not available anymore */
898 issue_command(info, CHA, CMD_RXRESET);
899 if (debug_level >= DEBUG_LEVEL_ISR)
900 printk("%s(%d):rx_ready_async(tty=NULL)\n",__FILE__,__LINE__);
901 return;
902 }
903
904 if (tcd) { 894 if (tcd) {
905 /* early termination, get FIFO count from RBCL register */ 895 /* early termination, get FIFO count from RBCL register */
906 fifo_count = (unsigned char)(read_reg(info, CHA+RBCL) & 0x1f); 896 fifo_count = (unsigned char)(read_reg(info, CHA+RBCL) & 0x1f);
@@ -913,7 +903,7 @@ static void rx_ready_async(MGSLPC_INFO *info, int tcd, struct tty_struct *tty)
913 } else 903 } else
914 fifo_count = 32; 904 fifo_count = 32;
915 905
916 tty_buffer_request_room(tty, fifo_count); 906 tty_buffer_request_room(port, fifo_count);
917 /* Flush received async data to receive data buffer. */ 907 /* Flush received async data to receive data buffer. */
918 while (fifo_count) { 908 while (fifo_count) {
919 data = read_reg(info, CHA + RXFIFO); 909 data = read_reg(info, CHA + RXFIFO);
@@ -944,7 +934,7 @@ static void rx_ready_async(MGSLPC_INFO *info, int tcd, struct tty_struct *tty)
944 else if (status & BIT6) 934 else if (status & BIT6)
945 flag = TTY_FRAME; 935 flag = TTY_FRAME;
946 } 936 }
947 work += tty_insert_flip_char(tty, data, flag); 937 work += tty_insert_flip_char(port, data, flag);
948 } 938 }
949 issue_command(info, CHA, CMD_RXFIFO); 939 issue_command(info, CHA, CMD_RXFIFO);
950 940
@@ -957,7 +947,7 @@ static void rx_ready_async(MGSLPC_INFO *info, int tcd, struct tty_struct *tty)
957 } 947 }
958 948
959 if (work) 949 if (work)
960 tty_flip_buffer_push(tty); 950 tty_flip_buffer_push(port);
961} 951}
962 952
963 953
@@ -1217,7 +1207,7 @@ static irqreturn_t mgslpc_isr(int dummy, void *dev_id)
1217 if (info->params.mode == MGSL_MODE_HDLC) 1207 if (info->params.mode == MGSL_MODE_HDLC)
1218 rx_ready_hdlc(info, isr & IRQ_RXEOM); 1208 rx_ready_hdlc(info, isr & IRQ_RXEOM);
1219 else 1209 else
1220 rx_ready_async(info, isr & IRQ_RXEOM, tty); 1210 rx_ready_async(info, isr & IRQ_RXEOM);
1221 } 1211 }
1222 1212
1223 /* transmit IRQs */ 1213 /* transmit IRQs */
@@ -1353,7 +1343,7 @@ static void shutdown(MGSLPC_INFO * info, struct tty_struct *tty)
1353 reset_device(info); 1343 reset_device(info);
1354 1344
1355 if (!tty || tty->termios.c_cflag & HUPCL) { 1345 if (!tty || tty->termios.c_cflag & HUPCL) {
1356 info->serial_signals &= ~(SerialSignal_DTR + SerialSignal_RTS); 1346 info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR);
1357 set_signals(info); 1347 set_signals(info);
1358 } 1348 }
1359 1349
@@ -1415,12 +1405,12 @@ static void mgslpc_change_params(MGSLPC_INFO *info, struct tty_struct *tty)
1415 1405
1416 cflag = tty->termios.c_cflag; 1406 cflag = tty->termios.c_cflag;
1417 1407
1418 /* if B0 rate (hangup) specified then negate DTR and RTS */ 1408 /* if B0 rate (hangup) specified then negate RTS and DTR */
1419 /* otherwise assert DTR and RTS */ 1409 /* otherwise assert RTS and DTR */
1420 if (cflag & CBAUD) 1410 if (cflag & CBAUD)
1421 info->serial_signals |= SerialSignal_RTS + SerialSignal_DTR; 1411 info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR;
1422 else 1412 else
1423 info->serial_signals &= ~(SerialSignal_RTS + SerialSignal_DTR); 1413 info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR);
1424 1414
1425 /* byte size and parity */ 1415 /* byte size and parity */
1426 1416
@@ -2311,7 +2301,7 @@ static void mgslpc_set_termios(struct tty_struct *tty, struct ktermios *old_term
2311 /* Handle transition to B0 status */ 2301 /* Handle transition to B0 status */
2312 if (old_termios->c_cflag & CBAUD && 2302 if (old_termios->c_cflag & CBAUD &&
2313 !(tty->termios.c_cflag & CBAUD)) { 2303 !(tty->termios.c_cflag & CBAUD)) {
2314 info->serial_signals &= ~(SerialSignal_RTS + SerialSignal_DTR); 2304 info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR);
2315 spin_lock_irqsave(&info->lock,flags); 2305 spin_lock_irqsave(&info->lock,flags);
2316 set_signals(info); 2306 set_signals(info);
2317 spin_unlock_irqrestore(&info->lock,flags); 2307 spin_unlock_irqrestore(&info->lock,flags);
@@ -2474,9 +2464,9 @@ static void dtr_rts(struct tty_port *port, int onoff)
2474 2464
2475 spin_lock_irqsave(&info->lock,flags); 2465 spin_lock_irqsave(&info->lock,flags);
2476 if (onoff) 2466 if (onoff)
2477 info->serial_signals |= SerialSignal_RTS + SerialSignal_DTR; 2467 info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR;
2478 else 2468 else
2479 info->serial_signals &= ~SerialSignal_RTS + SerialSignal_DTR; 2469 info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR);
2480 set_signals(info); 2470 set_signals(info);
2481 spin_unlock_irqrestore(&info->lock,flags); 2471 spin_unlock_irqrestore(&info->lock,flags);
2482} 2472}
@@ -2521,7 +2511,7 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp)
2521 goto cleanup; 2511 goto cleanup;
2522 } 2512 }
2523 2513
2524 tty->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0; 2514 port->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
2525 2515
2526 spin_lock_irqsave(&info->netlock, flags); 2516 spin_lock_irqsave(&info->netlock, flags);
2527 if (info->netcount) { 2517 if (info->netcount) {
@@ -2674,6 +2664,14 @@ static int rx_alloc_buffers(MGSLPC_INFO *info)
2674 if (info->rx_buf == NULL) 2664 if (info->rx_buf == NULL)
2675 return -ENOMEM; 2665 return -ENOMEM;
2676 2666
2667 /* unused flag buffer to satisfy receive_buf calling interface */
2668 info->flag_buf = kzalloc(info->max_frame_size, GFP_KERNEL);
2669 if (!info->flag_buf) {
2670 kfree(info->rx_buf);
2671 info->rx_buf = NULL;
2672 return -ENOMEM;
2673 }
2674
2677 rx_reset_buffers(info); 2675 rx_reset_buffers(info);
2678 return 0; 2676 return 0;
2679} 2677}
@@ -2682,6 +2680,8 @@ static void rx_free_buffers(MGSLPC_INFO *info)
2682{ 2680{
2683 kfree(info->rx_buf); 2681 kfree(info->rx_buf);
2684 info->rx_buf = NULL; 2682 info->rx_buf = NULL;
2683 kfree(info->flag_buf);
2684 info->flag_buf = NULL;
2685} 2685}
2686 2686
2687static int claim_resources(MGSLPC_INFO *info) 2687static int claim_resources(MGSLPC_INFO *info)
@@ -3575,8 +3575,8 @@ static void get_signals(MGSLPC_INFO *info)
3575{ 3575{
3576 unsigned char status = 0; 3576 unsigned char status = 0;
3577 3577
3578 /* preserve DTR and RTS */ 3578 /* preserve RTS and DTR */
3579 info->serial_signals &= SerialSignal_DTR + SerialSignal_RTS; 3579 info->serial_signals &= SerialSignal_RTS | SerialSignal_DTR;
3580 3580
3581 if (read_reg(info, CHB + VSTR) & BIT7) 3581 if (read_reg(info, CHB + VSTR) & BIT7)
3582 info->serial_signals |= SerialSignal_DCD; 3582 info->serial_signals |= SerialSignal_DCD;
@@ -3590,7 +3590,7 @@ static void get_signals(MGSLPC_INFO *info)
3590 info->serial_signals |= SerialSignal_DSR; 3590 info->serial_signals |= SerialSignal_DSR;
3591} 3591}
3592 3592
3593/* Set the state of DTR and RTS based on contents of 3593/* Set the state of RTS and DTR based on contents of
3594 * serial_signals member of device extension. 3594 * serial_signals member of device extension.
3595 */ 3595 */
3596static void set_signals(MGSLPC_INFO *info) 3596static void set_signals(MGSLPC_INFO *info)
@@ -4009,8 +4009,8 @@ static int hdlcdev_open(struct net_device *dev)
4009 spin_unlock_irqrestore(&info->netlock, flags); 4009 spin_unlock_irqrestore(&info->netlock, flags);
4010 return rc; 4010 return rc;
4011 } 4011 }
4012 /* assert DTR and RTS, apply hardware settings */ 4012 /* assert RTS and DTR, apply hardware settings */
4013 info->serial_signals |= SerialSignal_RTS + SerialSignal_DTR; 4013 info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR;
4014 mgslpc_program_hw(info, tty); 4014 mgslpc_program_hw(info, tty);
4015 tty_kref_put(tty); 4015 tty_kref_put(tty);
4016 4016