diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-22 01:41:04 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-22 01:41:04 +0400 |
commit | 21eaab6d19ed43e82ed39c8deb7f192134fb4a0e (patch) | |
tree | d995205afdcb7f47462bcd28067dc0c4ab0b7b02 /drivers/isdn | |
parent | 74e1a2a39355b2d3ae8c60c78d8add162c6d7183 (diff) | |
parent | 9e17df37d710f8998e9cb10a548304fe33d4a5c2 (diff) | |
download | linux-21eaab6d19ed43e82ed39c8deb7f192134fb4a0e.tar.xz |
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/isdn')
-rw-r--r-- | drivers/isdn/Kconfig | 1 | ||||
-rw-r--r-- | drivers/isdn/capi/Kconfig | 1 | ||||
-rw-r--r-- | drivers/isdn/gigaset/Kconfig | 1 | ||||
-rw-r--r-- | drivers/isdn/gigaset/interface.c | 14 | ||||
-rw-r--r-- | drivers/isdn/hardware/mISDN/Kconfig | 1 | ||||
-rw-r--r-- | drivers/isdn/i4l/isdn_common.c | 14 | ||||
-rw-r--r-- | drivers/isdn/i4l/isdn_common.h | 2 | ||||
-rw-r--r-- | drivers/isdn/i4l/isdn_tty.c | 59 |
8 files changed, 42 insertions, 51 deletions
diff --git a/drivers/isdn/Kconfig b/drivers/isdn/Kconfig index 86cd75a0e84d..ef661acdda17 100644 --- a/drivers/isdn/Kconfig +++ b/drivers/isdn/Kconfig @@ -22,6 +22,7 @@ if ISDN menuconfig ISDN_I4L tristate "Old ISDN4Linux (deprecated)" + depends on TTY ---help--- This driver allows you to use an ISDN adapter for networking connections and as dialin/out device. The isdn-tty's have a built diff --git a/drivers/isdn/capi/Kconfig b/drivers/isdn/capi/Kconfig index 15c3ffd9d860..f04686580040 100644 --- a/drivers/isdn/capi/Kconfig +++ b/drivers/isdn/capi/Kconfig @@ -18,6 +18,7 @@ config CAPI_TRACE config ISDN_CAPI_MIDDLEWARE bool "CAPI2.0 Middleware support" + depends on TTY help This option will enhance the capabilities of the /dev/capi20 interface. It will provide a means of moving a data connection, diff --git a/drivers/isdn/gigaset/Kconfig b/drivers/isdn/gigaset/Kconfig index b18a92c32184..dde5e09e6267 100644 --- a/drivers/isdn/gigaset/Kconfig +++ b/drivers/isdn/gigaset/Kconfig @@ -1,5 +1,6 @@ menuconfig ISDN_DRV_GIGASET tristate "Siemens Gigaset support" + depends on TTY select CRC_CCITT select BITREVERSE help diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c index 20b7e7a1190f..e2b539675b66 100644 --- a/drivers/isdn/gigaset/interface.c +++ b/drivers/isdn/gigaset/interface.c @@ -134,7 +134,7 @@ static int if_open(struct tty_struct *tty, struct file *filp) if (cs->port.count == 1) { tty_port_tty_set(&cs->port, tty); - tty->low_latency = 1; + cs->port.low_latency = 1; } mutex_unlock(&cs->mutex); @@ -546,16 +546,8 @@ void gigaset_if_free(struct cardstate *cs) void gigaset_if_receive(struct cardstate *cs, unsigned char *buffer, size_t len) { - struct tty_struct *tty = tty_port_tty_get(&cs->port); - - if (tty == NULL) { - gig_dbg(DEBUG_IF, "receive on closed device"); - return; - } - - tty_insert_flip_string(tty, buffer, len); - tty_flip_buffer_push(tty); - tty_kref_put(tty); + tty_insert_flip_string(&cs->port, buffer, len); + tty_flip_buffer_push(&cs->port); } EXPORT_SYMBOL_GPL(gigaset_if_receive); diff --git a/drivers/isdn/hardware/mISDN/Kconfig b/drivers/isdn/hardware/mISDN/Kconfig index eadc1cd34a20..b8611e3e5e74 100644 --- a/drivers/isdn/hardware/mISDN/Kconfig +++ b/drivers/isdn/hardware/mISDN/Kconfig @@ -76,6 +76,7 @@ config MISDN_NETJET tristate "Support for NETJet cards" depends on MISDN depends on PCI + depends on TTY select MISDN_IPAC select ISDN_HDLC select ISDN_I4L diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c index e2a945ee9f05..b87d9e577be2 100644 --- a/drivers/isdn/i4l/isdn_common.c +++ b/drivers/isdn/i4l/isdn_common.c @@ -876,7 +876,7 @@ isdn_readbchan(int di, int channel, u_char *buf, u_char *fp, int len, wait_queue * of the mapping (di,ch)<->minor, happen during the sleep? --he */ int -isdn_readbchan_tty(int di, int channel, struct tty_struct *tty, int cisco_hack) +isdn_readbchan_tty(int di, int channel, struct tty_port *port, int cisco_hack) { int count; int count_pull; @@ -891,7 +891,7 @@ isdn_readbchan_tty(int di, int channel, struct tty_struct *tty, int cisco_hack) if (skb_queue_empty(&dev->drv[di]->rpqueue[channel])) return 0; - len = tty_buffer_request_room(tty, dev->drv[di]->rcvcount[channel]); + len = tty_buffer_request_room(port, dev->drv[di]->rcvcount[channel]); if (len == 0) return len; @@ -912,7 +912,7 @@ isdn_readbchan_tty(int di, int channel, struct tty_struct *tty, int cisco_hack) while ((count_pull < skb->len) && (len > 0)) { /* push every character but the last to the tty buffer directly */ if (count_put) - tty_insert_flip_char(tty, last, TTY_NORMAL); + tty_insert_flip_char(port, last, TTY_NORMAL); len--; if (dev->drv[di]->DLEflag & DLEmask) { last = DLE; @@ -940,7 +940,7 @@ isdn_readbchan_tty(int di, int channel, struct tty_struct *tty, int cisco_hack) } count_put = count_pull; if (count_put > 1) - tty_insert_flip_string(tty, skb->data, count_put - 1); + tty_insert_flip_string(port, skb->data, count_put - 1); last = skb->data[count_put - 1]; len -= count_put; #ifdef CONFIG_ISDN_AUDIO @@ -952,16 +952,16 @@ isdn_readbchan_tty(int di, int channel, struct tty_struct *tty, int cisco_hack) * Now we can dequeue it. */ if (cisco_hack) - tty_insert_flip_char(tty, last, 0xFF); + tty_insert_flip_char(port, last, 0xFF); else - tty_insert_flip_char(tty, last, TTY_NORMAL); + tty_insert_flip_char(port, last, TTY_NORMAL); #ifdef CONFIG_ISDN_AUDIO ISDN_AUDIO_SKB_LOCK(skb) = 0; #endif skb = skb_dequeue(&dev->drv[di]->rpqueue[channel]); dev_kfree_skb(skb); } else { - tty_insert_flip_char(tty, last, TTY_NORMAL); + tty_insert_flip_char(port, last, TTY_NORMAL); /* Not yet emptied this buff, so it * must stay in the queue, for further calls * but we pull off the data we got until now. diff --git a/drivers/isdn/i4l/isdn_common.h b/drivers/isdn/i4l/isdn_common.h index 9a471f62e1d4..2260ef07ab9c 100644 --- a/drivers/isdn/i4l/isdn_common.h +++ b/drivers/isdn/i4l/isdn_common.h @@ -37,7 +37,7 @@ extern void isdn_timer_ctrl(int tf, int onoff); extern void isdn_unexclusive_channel(int di, int ch); extern int isdn_getnum(char **); extern int isdn_readbchan(int, int, u_char *, u_char *, int, wait_queue_head_t *); -extern int isdn_readbchan_tty(int, int, struct tty_struct *, int); +extern int isdn_readbchan_tty(int, int, struct tty_port *, int); extern int isdn_get_free_channel(int, int, int, int, int, char *); extern int isdn_writebuf_skb_stub(int, int, int, struct sk_buff *); extern int register_isdn(isdn_if *i); diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index e09dc8a5e743..d8a7d8323414 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c @@ -60,18 +60,14 @@ static int si2bit[8] = static int isdn_tty_try_read(modem_info *info, struct sk_buff *skb) { + struct tty_port *port = &info->port; int c; int len; - struct tty_struct *tty; char last; if (!info->online) return 0; - tty = info->port.tty; - if (!tty) - return 0; - if (!(info->mcr & UART_MCR_RTS)) return 0; @@ -81,7 +77,7 @@ isdn_tty_try_read(modem_info *info, struct sk_buff *skb) #endif ; - c = tty_buffer_request_room(tty, len); + c = tty_buffer_request_room(port, len); if (c < len) return 0; @@ -91,25 +87,25 @@ isdn_tty_try_read(modem_info *info, struct sk_buff *skb) unsigned char *dp = skb->data; while (--l) { if (*dp == DLE) - tty_insert_flip_char(tty, DLE, 0); - tty_insert_flip_char(tty, *dp++, 0); + tty_insert_flip_char(port, DLE, 0); + tty_insert_flip_char(port, *dp++, 0); } if (*dp == DLE) - tty_insert_flip_char(tty, DLE, 0); + tty_insert_flip_char(port, DLE, 0); last = *dp; } else { #endif if (len > 1) - tty_insert_flip_string(tty, skb->data, len - 1); + tty_insert_flip_string(port, skb->data, len - 1); last = skb->data[len - 1]; #ifdef CONFIG_ISDN_AUDIO } #endif if (info->emu.mdmreg[REG_CPPP] & BIT_CPPP) - tty_insert_flip_char(tty, last, 0xFF); + tty_insert_flip_char(port, last, 0xFF); else - tty_insert_flip_char(tty, last, TTY_NORMAL); - tty_flip_buffer_push(tty); + tty_insert_flip_char(port, last, TTY_NORMAL); + tty_flip_buffer_push(port); kfree_skb(skb); return 1; @@ -126,7 +122,6 @@ isdn_tty_readmodem(void) int midx; int i; int r; - struct tty_struct *tty; modem_info *info; for (i = 0; i < ISDN_MAX_CHANNELS; i++) { @@ -144,20 +139,21 @@ isdn_tty_readmodem(void) if ((info->vonline & 1) && (info->emu.vpar[1])) isdn_audio_eval_silence(info); #endif - tty = info->port.tty; - if (tty) { - if (info->mcr & UART_MCR_RTS) { - /* CISCO AsyncPPP Hack */ - if (!(info->emu.mdmreg[REG_CPPP] & BIT_CPPP)) - r = isdn_readbchan_tty(info->isdn_driver, info->isdn_channel, tty, 0); - else - r = isdn_readbchan_tty(info->isdn_driver, info->isdn_channel, tty, 1); - if (r) - tty_flip_buffer_push(tty); - } else - r = 1; + if (info->mcr & UART_MCR_RTS) { + /* CISCO AsyncPPP Hack */ + if (!(info->emu.mdmreg[REG_CPPP] & BIT_CPPP)) + r = isdn_readbchan_tty(info->isdn_driver, + info->isdn_channel, + &info->port, 0); + else + r = isdn_readbchan_tty(info->isdn_driver, + info->isdn_channel, + &info->port, 1); + if (r) + tty_flip_buffer_push(&info->port); } else r = 1; + if (r) { info->rcvsched = 0; resched = 1; @@ -2229,7 +2225,7 @@ isdn_tty_stat_callback(int i, isdn_ctrl *c) void isdn_tty_at_cout(char *msg, modem_info *info) { - struct tty_struct *tty; + struct tty_port *port = &info->port; atemu *m = &info->emu; char *p; char c; @@ -2246,15 +2242,14 @@ isdn_tty_at_cout(char *msg, modem_info *info) l = strlen(msg); spin_lock_irqsave(&info->readlock, flags); - tty = info->port.tty; - if ((info->port.flags & ASYNC_CLOSING) || (!tty)) { + if (port->flags & ASYNC_CLOSING) { spin_unlock_irqrestore(&info->readlock, flags); return; } /* use queue instead of direct, if online and */ /* data is in queue or buffer is full */ - if (info->online && ((tty_buffer_request_room(tty, l) < l) || + if (info->online && ((tty_buffer_request_room(port, l) < l) || !skb_queue_empty(&dev->drv[info->isdn_driver]->rpqueue[info->isdn_channel]))) { skb = alloc_skb(l, GFP_ATOMIC); if (!skb) { @@ -2285,7 +2280,7 @@ isdn_tty_at_cout(char *msg, modem_info *info) if (skb) { *sp++ = c; } else { - if (tty_insert_flip_char(tty, c, TTY_NORMAL) == 0) + if (tty_insert_flip_char(port, c, TTY_NORMAL) == 0) break; } } @@ -2299,7 +2294,7 @@ isdn_tty_at_cout(char *msg, modem_info *info) } else { spin_unlock_irqrestore(&info->readlock, flags); - tty_flip_buffer_push(tty); + tty_flip_buffer_push(port); } } |