diff options
Diffstat (limited to 'drivers/isdn/i4l')
-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 |
3 files changed, 35 insertions, 40 deletions
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); } } |